stop all motors when pressing escape
This commit is contained in:
parent
f875681661
commit
77fb64043d
@ -165,8 +165,10 @@ namespace brick {
|
|||||||
}
|
}
|
||||||
// this needs to be done in query(), which is run without the main JS execution mutex
|
// this needs to be done in query(), which is run without the main JS execution mutex
|
||||||
// otherwise, while(true){} will lock the device
|
// otherwise, while(true){} will lock the device
|
||||||
if (ret & DAL.BUTTON_ID_ESCAPE)
|
if (ret & DAL.BUTTON_ID_ESCAPE) {
|
||||||
|
motors.stopAllMotors();
|
||||||
control.reset()
|
control.reset()
|
||||||
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +233,7 @@ namespace control {
|
|||||||
/**
|
/**
|
||||||
* Determine the version of system software currently running.
|
* Determine the version of system software currently running.
|
||||||
*/
|
*/
|
||||||
|
//%
|
||||||
export function deviceFirmwareVersion(): string {
|
export function deviceFirmwareVersion(): string {
|
||||||
let buf = output.createBuffer(6)
|
let buf = output.createBuffer(6)
|
||||||
brick.internal.getBtnsMM().read(buf)
|
brick.internal.getBtnsMM().read(buf)
|
||||||
|
Loading…
Reference in New Issue
Block a user