Start an event handler (part of the program that will run when something happens) This handler works when you do a gesture (like shaking the Calliope mini).
input.onGesture(Gesture.Shake,() => {
})
gesture
means the way you hold or move the Calliope mini. This can be shake
, logo up
, logo down
, screen up
, screen down
, tilt left
, tilt right
, free fall
, 3g
, or 6g
.This program shows a number from 0
to 9
when you shake the Calliope mini.
input.onGesture(Gesture.Shake,() => {
let x = Math.random(10)
basic.showNumber(x, 100)
})