-
Notifications
You must be signed in to change notification settings - Fork 0
Shake
Tiogaplanet edited this page Oct 9, 2018
·
2 revisions
Read whether MiP has been shaken (robot abuse!).
bool hasBeenShaken()
Returns whether MiP has been shaken since the previous call.
None
- true if MiP has been shaken by the user since the previous call.
- false otherwise.
#include <mip_esp8266.h>
MiP mip;
void setup() {
bool connectResult = mip.begin();
if (!connectResult) {
Serial.println(F("Failed connecting to MiP!"));
return;
}
Serial.println(F("Shake.ino - Detect shakes."));
}
void loop() {
if (mip.hasBeenShaken()) {
Serial.println(F("Shake detected!"));
}
}