Skip to main content

Shake Detector

This is an example of how to use the Script node to implement a "Shake detector".

Inputs

DataDescription
TimeoutThe minimum time between two shakes
ThresholdHow much the phone has to be moved until a shake is detected
SignalDescription
Request PermissionSome systems, mainly iOS, requires the user to give the web app permission to use the sensors. This signal will open a popup that allows the users to grant permission.

Outputs

DataDescription
Needs PermissionTrue if permission is required for accessing the device sensors. Usually true on iOS, and false on other systems. Will also be false on iOS after permission has been granted
SignalDescription
Shake DetectedA shake has been detected!