mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-20 03:21:46 +02:00
merge into Back_to_Origin
This commit is contained in:
parent
a5f8af6d3c
commit
4d62e30cc6
34
example/IMU/Back_to_Origin/Back_to_Origin.ino
Normal file
34
example/IMU/Back_to_Origin/Back_to_Origin.ino
Normal file
@ -0,0 +1,34 @@
|
||||
#include "Dezibot.h"
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
dezibot.begin();
|
||||
Serial.begin(115200);
|
||||
|
||||
Serial.println("AAA");
|
||||
}
|
||||
|
||||
//https://esp32cube.com/basis/032_millis/
|
||||
|
||||
int indices = 0;
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
|
||||
|
||||
|
||||
int zvalue = 0;
|
||||
for(int i = 0; i<30;i++){
|
||||
zvalue += dezibot.motionDetection.getAcceleration().z;
|
||||
}
|
||||
zvalue = zvalue/30;
|
||||
|
||||
if(zvalue < -1700){
|
||||
dezibot.multiColorLight.setLed(ALL,0x004000);
|
||||
Serial.println("AAA");
|
||||
} else if(zvalue > 1700){
|
||||
dezibot.multiColorLight.setLed(ALL,0x400000);
|
||||
} else {
|
||||
dezibot.multiColorLight.turnOffLed();
|
||||
}
|
||||
}
|
||||
|
2579
src/dezibot
Normal file
2579
src/dezibot
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user