use safer switch

This commit is contained in:
smayzy 2026-03-02 18:35:21 +01:00
parent f6ea5f6ab9
commit 57d47e7558

View File

@ -57,14 +57,20 @@ void loop() {
switch (rxId) {
case 0x382 : {
if (len >= 2) {
rpm = buf[0] | (buf[1] << 8);
v = rpm * 0.017;
Serial.println(v);
};
break;
}
case 0x209 : {
if (len >= 2) {
ubat = buf[0] | (buf[1] << 8);
ubatr = ubat / 16;
Serial.println(ubatr);
};
break;
}
}
}