added block to convert gesture in number

This commit is contained in:
Michael Klein 2020-09-17 22:14:57 +02:00
parent 8d81b2a132
commit 65171081a9

10
main.ts
View File

@ -574,7 +574,15 @@ namespace grove {
return joystick.joyread(xpin, ypin); return joystick.joyread(xpin, ypin);
} }
/**
* Converts the gesture name to a number
* Useful for comparisons
*/
//% blockId=ggesture block="%key"
export function ggesture(g: GroveGesture): number {
return g;
}
/** /**
* Do something when a gesture is detected by Grove - Gesture * Do something when a gesture is detected by Grove - Gesture
* @param gesture type of gesture to detect * @param gesture type of gesture to detect