Updated Lua Scripting (markdown)

This commit is contained in:
rusefillc 2021-10-19 11:03:19 -04:00
parent 7a8dd01452
commit c7b2af0b3b
1 changed files with 10 additions and 0 deletions

View File

@ -203,6 +203,7 @@ Set the duty cycle of the specified PWM channel.
```
t = Timer.new();
timingAdd = 0;
function onTick()
auxV = getAuxAnalog(0)
@ -210,8 +211,17 @@ function onTick()
if auxV > 2 then
t:reset();
end
val = t:getElapsedSeconds();
if t:getElapsedSeconds() < 3 then
timingAdd = 10;
else
timingAdd = 0;
end
setTimingAdd(timingAdd)
print('Hello analog ' .. auxV .. " " .. val)
end
```