加入闪灯控制,已大量测试
This commit is contained in:
parent
c1f72272b1
commit
f70081bf46
@ -137,9 +137,9 @@ namespace Plane.Copters
|
||||
public async Task SetShowLEDAsync(bool Ledon)
|
||||
{
|
||||
if (Ledon)
|
||||
await SetParamAsync("NTF_SHOWLED", 1, 5000);
|
||||
await SetParamNoCheckAsync("NTF_SHOWLED", 1);
|
||||
else
|
||||
await SetParamAsync("NTF_SHOWLED", 0, 5000);
|
||||
await SetParamNoCheckAsync("NTF_SHOWLED", 0);
|
||||
_showLed = Ledon;
|
||||
}
|
||||
|
||||
@ -170,6 +170,14 @@ namespace Plane.Copters
|
||||
|
||||
}
|
||||
|
||||
public async Task SetParamNoCheckAsync(string paramName, float paramValue)
|
||||
{
|
||||
for (int ii = 0; ii < 5; ii++)
|
||||
{
|
||||
await _internalCopter.SetParam2Async(paramName, paramValue).ConfigureAwait(false);
|
||||
await Task.Delay(5).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
public async Task SetParamAsync(string paramName, float paramValue, int millisecondsTimeout = Timeout.Infinite)
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
|
Loading…
Reference in New Issue
Block a user