Dezibot 4
Back_to_Origin.ino
Go to the documentation of this file.
1 #include "Dezibot.h"
2 Dezibot dezibot = Dezibot();
3 void setup() {
4  // put your setup code here, to run once:
5  dezibot.begin();
6  Serial.begin(115200);
7 
8  Serial.println("AAA");
9 }
10 
11 //https://esp32cube.com/basis/032_millis/
12 
13 int indices = 0;
14 void loop() {
15  // put your main code here, to run repeatedly:
16 
17 
18 
19  int zvalue = 0;
20  for(int i = 0; i<30;i++){
21  zvalue += dezibot.motion.detection.getAcceleration().z;
22  }
23  zvalue = zvalue/30;
24 
25  if(zvalue < -1700){
26  dezibot.multiColorLight.setLed(ALL,0x004000);
27  Serial.println("AAA");
28  } else if(zvalue > 1700){
29  dezibot.multiColorLight.setLed(ALL,0x400000);
30  } else {
31  dezibot.multiColorLight.turnOffLed();
32  }
33 }
34