Shop OBEX P1 Docs P2 Docs Learn Events
regarding arlo robot speed control code. — Parallax Forums

regarding arlo robot speed control code.

vaibhavvaibhav Posts: 25
edited 2019-09-04 22:40 in Robotics
i am running the code given below using simple ide and propeller board but it is not working can you please help me?
actually at start robot is moving but after 2-3 seconds speed is increasing and then motor stops.


while(1)
        {
             a1=current0check();     //checking current taken by motor
             delay_ms(20);
             a2=current1check();    //checking current taken by other motor
             delay_ms(20);
             a3=anglecheck();     //checking angle between two wheels
             delay_ms(20);
             
             if(t>=50)       //after approx. 10sec changing speed of one wheel from n to n+1
             {
               n=n+1;
               t=0;
               drive_goto(-93, 93);
               pause(3000);
             }
             else
             {
               moveforward(m, n);     //at starting m=40, n=40
               delay_ms(10);
               print("n= %d",n);
               t=t+1;            
             }
           }
         }     

void moveforward(int m, int n)
{
  drive_speed(m, n);
  pause(200);
}


ModEdit: Code tags added.

Comments

Sign In or Register to comment.