mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 11:01:46 +02:00
updated Motiondetection in examples
This commit is contained in:
parent
a0e6661b16
commit
b5fab21a47
@ -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");
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user