Skip to content

Commit fea0c60

Browse files
Update RoboHeartRotation.ino
Treshold of calibration
1 parent 5ebf873 commit fea0c60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/RoboHeartRotation/RoboHeartRotation.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <RoboHeart.h>
1111
#include <Wire.h>
1212
#include <math.h>
13-
#define TRESHOLD 0.1 //treshold in rad/s
13+
#define TRESHOLD 0.3 //treshold in rad/s
1414

1515
float drift_x = 0;
1616
float drift_y = 0;
@@ -31,7 +31,7 @@ void calculateDrifts(int timeout_ms = 500) {
3131
}
3232
}
3333

34-
bool isCalibrated(int timeout_ms = 1000) {
34+
bool isCalibrated(int timeout_ms = 200) {
3535
unsigned long time = millis();
3636
long counter = 0;
3737
while ((millis() - time) < timeout_ms) {
@@ -40,7 +40,7 @@ bool isCalibrated(int timeout_ms = 1000) {
4040
}
4141
delay(1);
4242
}
43-
return (counter < (timeout_ms / 5));
43+
return (counter < (timeout_ms / 3));
4444
}
4545

4646
float rotation[3] = { 0, 0, 0 };

0 commit comments

Comments
 (0)