updated Motiondetection in examples

This commit is contained in:
Hans Haupt 2024-06-14 08:39:41 +02:00
parent a0e6661b16
commit b5fab21a47
4 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ void setup() {
} }
void loop() { void loop() {
switch (dezibot.motionDetection.getTiltDirection()) { switch (dezibot.motion.detection.getTiltDirection()) {
case Front: case Front:
dezibot.multiColorLight.setTopLeds(GREEN); dezibot.multiColorLight.setTopLeds(GREEN);
dezibot.communication.sendMessage("vorn"); dezibot.communication.sendMessage("vorn");

View File

@ -11,9 +11,9 @@ dezibot.multiColorLight.turnOffLed();
void loop() { void loop() {
// put your main code here, to run repeatedly: // put your main code here, to run repeatedly:
if(dezibot.motionDetection.isShaken(1000,zAxis)){ if(dezibot.motion.detection.isShaken(1000,zAxis)){
dezibot.multiColorLight.setTopLeds(0xFF0000); dezibot.multiColorLight.setTopLeds(0xFF0000);
} else if(dezibot.motionDetection.isShaken(1000,xAxis|yAxis)) { } else if(dezibot.motion.detection.isShaken(1000,xAxis|yAxis)) {
dezibot.multiColorLight.setTopLeds(0x00FF00); dezibot.multiColorLight.setTopLeds(0x00FF00);
} }
} }

View File

@ -9,7 +9,7 @@ void setup() {
} }
void loop() { void loop() {
switch (dezibot.motionDetection.getTiltDirection()) { switch (dezibot.motion.detection.getTiltDirection()) {
case Front: case Front:
dezibot.multiColorLight.setTopLeds(GREEN); dezibot.multiColorLight.setTopLeds(GREEN);
break; break;

View File

@ -13,7 +13,7 @@ void loop() {
int zvalue = 0; int zvalue = 0;
for(int i = 0; i<30;i++){ for(int i = 0; i<30;i++){
zvalue += dezibot.motionDetection.getAcceleration().z; zvalue += dezibot.motion.detection.getAcceleration().z;
} }
zvalue = zvalue/30; zvalue = zvalue/30;
if(zvalue < -1700){ if(zvalue < -1700){