Dezibot 4
shake_detection.ino
Go to the documentation of this file.
1 #include "Dezibot.h"
2 
3 Dezibot dezibot = Dezibot();
4 void setup() {
5  // put your setup code here, to run once:
6 
7 dezibot.begin();
8 dezibot.multiColorLight.turnOffLed();
9 
10 }
11 
12 void loop() {
13  // put your main code here, to run repeatedly:
14 if(dezibot.motion.detection.isShaken(1000,zAxis)){
15  dezibot.multiColorLight.setTopLeds(0xFF0000);
16 } else if(dezibot.motion.detection.isShaken(1000,xAxis|yAxis)) {
17  dezibot.multiColorLight.setTopLeds(0x00FF00);
18 }
19 }