mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-21 12:01:47 +02:00
adapted default threshold for shakedetection
This commit is contained in:
parent
4a6a58e35f
commit
bc2aef650d
@ -64,9 +64,8 @@ int8_t MotionDetection::getWhoAmI(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool MotionDetection::isShaken(uint32_t threshold ,uint8_t axis){
|
bool MotionDetection::isShaken(uint32_t threshold ,uint8_t axis){
|
||||||
IMUResult measurment1 = this->getAcceleration();
|
IMUResult measurment1;
|
||||||
delayMicroseconds(10);
|
IMUResult measurment2;
|
||||||
IMUResult measurment2 = this->getAcceleration();
|
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
for(uint i = 0;i<20;i++){
|
for(uint i = 0;i<20;i++){
|
||||||
measurment1 = this->getAcceleration();
|
measurment1 = this->getAcceleration();
|
||||||
@ -80,7 +79,6 @@ bool MotionDetection::isShaken(uint32_t threshold ,uint8_t axis){
|
|||||||
}
|
}
|
||||||
delayMicroseconds(15);
|
delayMicroseconds(15);
|
||||||
}
|
}
|
||||||
Serial.println(count);
|
|
||||||
return (count > 6);
|
return (count > 6);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ protected:
|
|||||||
static const uint8_t WHO_AM_I = 0x75;
|
static const uint8_t WHO_AM_I = 0x75;
|
||||||
|
|
||||||
static const uint frequency = 10000000;
|
static const uint frequency = 10000000;
|
||||||
static const uint16_t defaultShakeThreshold = 1000;
|
static const uint16_t defaultShakeThreshold = 500;
|
||||||
|
|
||||||
uint16_t cmdRead(uint8_t regHigh,uint8_t regLow);
|
uint16_t cmdRead(uint8_t regHigh,uint8_t regLow);
|
||||||
uint16_t cmdWrite(uint8_t regHigh,uint8_t regLow);
|
uint16_t cmdWrite(uint8_t regHigh,uint8_t regLow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user