From 3efae7684377216f632cef97f8439034b79336cd Mon Sep 17 00:00:00 2001 From: Fisch Date: Tue, 3 Dec 2019 22:53:56 +0100 Subject: [PATCH] more information on debug serial --- .../controller_stm_PotiTest_NewFoc.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/02_Arduino/controller_stm_PotiTest_NewFoc/controller_stm_PotiTest_NewFoc.ino b/02_Arduino/controller_stm_PotiTest_NewFoc/controller_stm_PotiTest_NewFoc.ino index 562ae97..61c9c74 100644 --- a/02_Arduino/controller_stm_PotiTest_NewFoc/controller_stm_PotiTest_NewFoc.ino +++ b/02_Arduino/controller_stm_PotiTest_NewFoc/controller_stm_PotiTest_NewFoc.ino @@ -110,8 +110,8 @@ void ReceiveSerial1() { // Check for new data availability in the Serial buffer if (Serial1.available()) { - incomingByte = Serial1.read(); // Read the incoming byte - bufStartFrame = ((uint16_t)(incomingBytePrev) << 8) + incomingByte; // Construct the start marker + incomingByte = Serial1.read(); // Read the incoming byte + bufStartFrame = ((uint16_t)(incomingBytePrev) << 8) + incomingByte; // Construct the start frame } else { return; @@ -137,8 +137,8 @@ void ReceiveSerial1() // Check if we reached the end of the package if (idx == sizeof(SerialFeedback)) { uint16_t checksum; - checksum = NewFeedback.start ^ NewFeedback.cmd1 ^ NewFeedback.cmd2 ^ NewFeedback.speedR ^ NewFeedback.speedL - ^ NewFeedback.speedR_meas ^ NewFeedback.speedL_meas ^ NewFeedback.batVoltage ^ NewFeedback.boardTemp; + checksum = (uint16_t)(NewFeedback.start ^ NewFeedback.cmd1 ^ NewFeedback.cmd2 ^ NewFeedback.speedR ^ NewFeedback.speedL + ^ NewFeedback.speedR_meas ^ NewFeedback.speedL_meas ^ NewFeedback.batVoltage ^ NewFeedback.boardTemp); // Check validity of the new data if (NewFeedback.start == START_FRAME && checksum == NewFeedback.checksum) { @@ -178,7 +178,7 @@ void loop() { int16_t speedvalue=constrain(analogRead(PIN_POTI)*1.0/MAXADCVALUE*1000, 0, 1000); SendSerial1(speedvalue,0); - Serial.println("-"); + Serial.print("millis="); Serial.print(millis()); Serial.print(", steer=0"); Serial.print(", speed="); Serial.println(speedvalue); last_send = millis();