backing up with encoder until the line follower find the lin
Author
Message
TomH
Rookie
Joined: Thu Mar 31, 2011 7:08 am Posts: 10
backing up with encoder until the line follower find the lin
I am trying to get the Vex robot to back up using the encoders until the three line followers I have mounted on the front of the robot finds the black line. So far I can run forward to follow the line so I know the line followers are working correctly. But when I try to go backwards it just sits there and skips the command.
I have tried an (if, else) move and a while move. I have copied and pasted the part of the program here. I am thinking because I am trying to run both encoders and line followers at the same time. Any help would be great.
while(SensorValue[righttracker]<950 && SensorValue[lefttracker]<950) //Placing an AND move for the two outside line followers to look for the black line { backup(); // the back up is a subroutine setup for the encoders to back up straight. }
motor[port3] = 0; //motor stop motor[port2] = 0;
Wed Apr 20, 2011 8:35 pm
vnguyen
Site Admin
Joined: Wed Jan 24, 2007 10:44 am Posts: 421 Location: Pittsburgh, PA
Re: backing up with encoder until the line follower find the lin
Can you post the code for the backup function?
_________________ Vu Nguyen Software Training Development Team | Webmaster Need more support? Use the ROBOTC Ticketing system
Re: backing up with encoder until the line follower find the lin
Hi Tom,
Keep in mind that when you move in reverse, your encoders are probably counting backward. Where moving forward you could have a condition "SensorValue[encoder] < 720", moving in reverse it must be more like "SensorValue[encoder] > -720".
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum