feat: report wheel speed and GPIO state periodically

This commit is contained in:
shenlefengnai-rgb
2026-10-05 19:49:49 +08:00
parent 34627fa6a0
commit 68e8fdbcb8
7 changed files with 234 additions and 335 deletions
+2 -2
View File
@@ -146,8 +146,8 @@ public partial class MainWindow : Window
case AdcId when d.Length >= 2:
string adc = $"{U16(d, 0)} mV ({U16(d, 0) / 1000.0:F3} V)";
AdcValue.Text = adc; return adc;
case PwmId when d.Length >= 8:
string pwm = string.Join(" / ", Enumerable.Range(0, 4).Select(i => $"{U16(d, i * 2)} Hz"));
case PwmId when d.Length >= 4:
string pwm = $"左前 PA0={U16(d, 0) / 1000.0:F3} m/s / 右前 PA6={U16(d, 2) / 1000.0:F3} m/s";
PwmValue.Text = pwm; return pwm;
case DacAckId when d.Length >= 4:
string ack = $"DAC{d[1]} {(d[0] == 1 ? "OK" : "ERR")} = {U16(d, 2)} mV";