diff --git a/Software/Software.ino b/Software/Software.ino index 239a34a3..3a3804df 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -404,8 +404,9 @@ void send_can() { #ifdef SERIAL_LINK_RECEIVER //---- Receives serial data and transfers to the Inverter void receive_serial() { - static unsigned long currentMillis = millis(); - if (currentMillis - previousMillis1ms > interval1) { //--- try 2 second + unsigned long currentMillis = millis(); + Serial.println(currentMillis); + if (currentMillis - previousMillis1ms >= interval1) { //--- try 2 second previousMillis1ms = currentMillis; manageSerialLinkReceiver(); } @@ -415,9 +416,9 @@ void receive_serial() { #ifdef SERIAL_LINK_TRANSMITTER //---- Gets data from Battery and serial Transmits the data to the Receiver void send_serial() { - static unsigned long currentMillis = millis(); + unsigned long currentMillis = millis(); if (bms_status == ACTIVE) { - if (currentMillis - previousMillis1ms > interval1) { //--- try 2 second + if (currentMillis - previousMillis1ms >= interval1) { //--- try 2 second previousMillis1ms = currentMillis; manageSerialLinkTransmitter(); } diff --git a/Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp b/Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp index a8693ff5..c42f9ab2 100644 --- a/Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp +++ b/Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp @@ -125,6 +125,7 @@ void manageSerialLinkReceiver() { } void update_values_serial_link() { + Serial.print("SOC: "); Serial.println(SOC); Serial.println(StateOfHealth); Serial.println(battery_voltage);