merge rusEFI wiki
This commit is contained in:
commit
5027bba002
|
@ -229,6 +229,7 @@ Set the duty cycle of the specified PWM channel.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
# timer
|
||||||
```
|
```
|
||||||
t = Timer.new();
|
t = Timer.new();
|
||||||
timingAdd = 0;
|
timingAdd = 0;
|
||||||
|
@ -257,7 +258,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# PWM
|
||||||
```
|
```
|
||||||
-- index 0, 100Hz, zero duty inititally
|
-- index 0, 100Hz, zero duty inititally
|
||||||
startPwm(0, 100, 0)
|
startPwm(0, 100, 0)
|
||||||
|
@ -271,7 +272,7 @@ function onTick()
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# CAN transmit
|
||||||
```
|
```
|
||||||
function onTick()
|
function onTick()
|
||||||
tps = getSensor("CLT")
|
tps = getSensor("CLT")
|
||||||
|
@ -289,8 +290,20 @@ function onTick()
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
# table
|
# CAN receive
|
||||||
|
```
|
||||||
|
canRxAdd(0x570)
|
||||||
|
function onCanRx(bus, id, dlc, data)
|
||||||
|
print('got CAN id=' .. id .. ' dlc=' .. dlc)
|
||||||
|
id11 = id % 2048
|
||||||
|
if id11 == 0x500 then --Check can state of BCM
|
||||||
|
canState = data[1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# table
|
||||||
```
|
```
|
||||||
tableIndex = findTableIndex("duty")
|
tableIndex = findTableIndex("duty")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue