View unanswered posts | View active topics It is currently Sun Oct 26, 2014 4:39 am






Reply to topic  [ 3 posts ] 
backing up with encoder until the line follower find the lin 
Author Message
Rookie

Joined: Thu Mar 31, 2011 7:08 am
Posts: 10
Post 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
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 439
Location: Pittsburgh, PA
Post 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

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Thu Apr 21, 2011 9:16 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post 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".

Hope that helps!

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Fri Apr 22, 2011 12:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.