Skip to content

Commit ae94421

Browse files
committed
fix: not sending tilts
1 parent e97923d commit ae94421

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Arduino_AlvikCarrier.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Arduino_AlvikCarrier::Arduino_AlvikCarrier(){
7171
first_wakeup = true;
7272
shake_time = 0;
7373
shake_counter = 0;
74-
tilt_status = 0;
74+
tilt_status = 0x80;
7575
xl = 0;
7676
xh = 0;
7777
yl = 0;
@@ -724,14 +724,15 @@ void Arduino_AlvikCarrier::updateImu(){
724724
tmp_tilt_status |= yh<<3;
725725
tmp_tilt_status |= yl<<2;
726726

727-
if (tilt_status == tmp_tilt_status){
727+
if (tilt_status != tmp_tilt_status){
728728
tilt_filter++;
729729
}else{
730730
tilt_filter = 0;
731731
}
732732

733733
if (tilt_filter>20){
734734
tilt_status = tmp_tilt_status;
735+
tilt_filter = 0;
735736
}
736737

737738
}

0 commit comments

Comments
 (0)