adding waitUntil to buttons
This commit is contained in:
@ -51,6 +51,21 @@ namespace sensors {
|
||||
this.button.onEvent(<ButtonEvent><number>ev, body)
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait until the touch sensor is touched
|
||||
* @param sensor the touch sensor that needs to be clicked or used
|
||||
* @param event the kind of button gesture that needs to be detected
|
||||
*/
|
||||
//% help=input/touch-sensor/wait-until
|
||||
//% blockId=touchWaitUntil block="wait until `icons.touchSensor` %sensor|%event"
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=98 blockGap=8
|
||||
//% group="Touch Sensor"
|
||||
waitUntil(ev: TouchSensorEvent) {
|
||||
this.button.waitUntil(<ButtonEvent><number>ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if touch sensor is touched.
|
||||
* @param sensor the port to query the request
|
||||
|
Reference in New Issue
Block a user