Merge remote-tracking branch 'technical-git/master'

This commit is contained in:
GitHub Action 2021-10-30 20:50:46 +00:00
commit 72a2e8f213
1 changed files with 18 additions and 0 deletions

View File

@ -250,5 +250,23 @@ function onTick()
-- lua does not have ternary ? : operator, this here means "100 if enable_pump and 0 otherwise"
setPwmDuty(0, enable_pump and 100 or 0)
end
```
```
function onTick()
tps = getSensor("CLT")
print('TPS ' .. tps)
voltage0 = getSensor("aux0")
txPayload = {}
// first byte: integer part, would be autoboxed to int
txPayload[1] = voltage0
// second byte: fractional part, would be autoboxed to int, overflow would be ignored
txPayload[2] = voltage0 * 256;
txCan(1, 0x600, 1, txPayload)
end
```