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;
3030uint8_t msg_size;
3131uint8_t ack_required=0 ;
3232int ack_counter=0 ;
33-
33+ bool ack_check= false ;
3434
3535unsigned long tmotor=0 ;
3636unsigned long tsend=0 ;
@@ -160,6 +160,7 @@ void loop(){
160160 alvik.rotate (value);
161161 ack_required=MOVEMENT_ROTATE;
162162 ack_counter=5 ;
163+ ack_check=true ;
163164 break ;
164165
165166 case ' G' :
@@ -168,6 +169,7 @@ void loop(){
168169 alvik.move (value);
169170 ack_required=MOVEMENT_MOVE;
170171 ack_counter=5 ;
172+ ack_check=true ;
171173 break ;
172174
173175 case ' Z' :
@@ -257,7 +259,7 @@ void loop(){
257259 tack=millis ();
258260 msg_size = packeter.packetC1B (' x' , 0 );
259261
260- if (alvik.isTargetReached ()){
262+ if (ack_check&& alvik.isTargetReached ()){
261263 if (ack_required==MOVEMENT_ROTATE){
262264 msg_size = packeter.packetC1B (' x' , ' R' );
263265 // ack_counter--;
@@ -268,6 +270,7 @@ void loop(){
268270 // ack_counter--;
269271 Serial.println (" M" );
270272 }
273+ ack_check=false ;
271274 }
272275
273276
You can’t perform that action at this time.
0 commit comments