From 65171081a9372218e8b43880f01d9087df28b7c4 Mon Sep 17 00:00:00 2001 From: Michael Klein <37311672+MKleinSB@users.noreply.github.com> Date: Thu, 17 Sep 2020 22:14:57 +0200 Subject: [PATCH] added block to convert gesture in number --- main.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 817567b..bd364d3 100644 --- a/main.ts +++ b/main.ts @@ -574,7 +574,15 @@ namespace grove { 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 * @param gesture type of gesture to detect