print to serial and set previous_time

This commit is contained in:
smayzy 2026-03-02 22:54:56 +01:00
parent 57d47e7558
commit eb9a43984f

View File

@ -60,6 +60,7 @@ void loop() {
if (len >= 2) { if (len >= 2) {
rpm = buf[0] | (buf[1] << 8); rpm = buf[0] | (buf[1] << 8);
v = rpm * 0.017; v = rpm * 0.017;
Serial.print("Vitesse = ");
Serial.println(v); Serial.println(v);
}; };
break; break;
@ -68,6 +69,7 @@ void loop() {
if (len >= 2) { if (len >= 2) {
ubat = buf[0] | (buf[1] << 8); ubat = buf[0] | (buf[1] << 8);
ubatr = ubat / 16; ubatr = ubat / 16;
Serial.print("Tension = ");
Serial.println(ubatr); Serial.println(ubatr);
}; };
break; break;
@ -77,6 +79,7 @@ void loop() {
current_time = millis(); current_time = millis();
if( current_time - previous_time >= timing){ if( current_time - previous_time >= timing){
previous_time = current_time;
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print("Vitesse = "); lcd.print("Vitesse = ");
lcd.print(v); lcd.print(v);