Merge remote-tracking branch 'technical-git/master'
This commit is contained in:
commit
72a2e8f213
|
@ -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
|
||||
```
|
Loading…
Reference in New Issue