reset motors on start
This commit is contained in:
parent
1b51320edb
commit
7e9d42a571
@ -35,7 +35,7 @@ namespace output {
|
|||||||
if (!pwmMM) control.fail("no PWM file")
|
if (!pwmMM) control.fail("no PWM file")
|
||||||
motorMM = control.mmap("/dev/lms_motor", MotorDataOff.Size * DAL.NUM_OUTPUTS, 0)
|
motorMM = control.mmap("/dev/lms_motor", MotorDataOff.Size * DAL.NUM_OUTPUTS, 0)
|
||||||
|
|
||||||
outputStopAll()
|
resetMotors()
|
||||||
|
|
||||||
let buf = output.createBuffer(1)
|
let buf = output.createBuffer(1)
|
||||||
buf[0] = DAL.opProgramStart
|
buf[0] = DAL.opProgramStart
|
||||||
@ -59,10 +59,8 @@ namespace output {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
function outputStopAll() {
|
function resetMotors() {
|
||||||
const b = mkCmd(Output.ALL, DAL.opOutputStop, 1)
|
reset(Output.ALL)
|
||||||
b.setNumber(NumberFormat.UInt8LE, 2, 0)
|
|
||||||
writePWM(b)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstances
|
//% fixedInstances
|
||||||
|
Loading…
Reference in New Issue
Block a user