File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ uint8_t control_type;
30
30
uint8_t msg_size;
31
31
uint8_t ack_required=0 ;
32
32
int ack_counter=0 ;
33
-
33
+ bool ack_check= false ;
34
34
35
35
unsigned long tmotor=0 ;
36
36
unsigned long tsend=0 ;
@@ -160,6 +160,7 @@ void loop(){
160
160
alvik.rotate (value);
161
161
ack_required=MOVEMENT_ROTATE;
162
162
ack_counter=5 ;
163
+ ack_check=true ;
163
164
break ;
164
165
165
166
case ' G' :
@@ -168,6 +169,7 @@ void loop(){
168
169
alvik.move (value);
169
170
ack_required=MOVEMENT_MOVE;
170
171
ack_counter=5 ;
172
+ ack_check=true ;
171
173
break ;
172
174
173
175
case ' Z' :
@@ -257,7 +259,7 @@ void loop(){
257
259
tack=millis ();
258
260
msg_size = packeter.packetC1B (' x' , 0 );
259
261
260
- if (alvik.isTargetReached ()){
262
+ if (ack_check&& alvik.isTargetReached ()){
261
263
if (ack_required==MOVEMENT_ROTATE){
262
264
msg_size = packeter.packetC1B (' x' , ' R' );
263
265
// ack_counter--;
@@ -268,6 +270,7 @@ void loop(){
268
270
// ack_counter--;
269
271
Serial.println (" M" );
270
272
}
273
+ ack_check=false ;
271
274
}
272
275
273
276
You can’t perform that action at this time.
0 commit comments