This commit is contained in:
xyy
2026-05-13 14:16:57 +08:00
parent ccf046865d
commit b4e45a519b

View File

@@ -325,9 +325,8 @@ namespace 头罩视野.Views
// return;
if (_modbusMaster == null)
return;
await _modbusMaster.ReadCoilsAsync(1, 1, 1);
var ret = await _modbusMaster.ReadCoilsAsync(1, 1, 1);
var ret = await _modbusMaster.ReadCoilsAsync(1, 1, 2);
if (ret != null && ret.Length > 0)
{ //左眼开
if (ret[0])
@@ -338,15 +337,14 @@ namespace 头罩视野.Views
btnLeft.Content = "左眼开";
btnRight.Content = "右眼关";
}
else
{
if ()
else if (ret[1])
{
LedOn(led0);
LedOff(led1);
btnLeft.Content = "左眼关";
btnRight.Content = "右眼开";
}
}
}