View unanswered posts | View active topics It is currently Tue Sep 23, 2014 4:24 am






Reply to topic  [ 5 posts ] 
Obstacle course----> line tracking 
Author Message
Rookie

Joined: Sun Nov 18, 2012 11:49 pm
Posts: 6
Post Obstacle course----> line tracking
On the obstacle course for liner tracking, I tried to modify my code several times but my robot keeps going in circles. :| help maybe? Thanks! :-)


Mon Nov 19, 2012 12:15 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 578
Post Re: Obstacle course----> line tracking
Please post your code using the [code][/code] tags so we can take a look at it and hopefully debug it.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Nov 19, 2012 12:07 pm
Profile
Rookie

Joined: Sun Nov 18, 2012 11:49 pm
Posts: 6
Post Re: Obstacle course----> line tracking
Here is my code :D

thanks! :-)


Attachments:
nxt_wait_for_push.c [3.91 KiB]
Downloaded 273 times
Mon Nov 19, 2012 2:24 pm
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: Obstacle course----> line tracking
The code that you intend for your line tracking isn't quite right...

Code:
while(SensorValue(lightSensor) < 45)
{
   motor[motorC] = 80;
   motor[motorB] = 0;
}
while(SensorValue(lightSensor) > 45)
{

   motor[motorC] = 0;
   motor[motorB] = 80;
}


The way that your robot will read this is that it will turn ONCE while the light sensor is less than 45, and then ONCE while it's greater than 45, then the program will end.

The videos in the Sensing > Line Tracking section of the ROBOTC Curriculum will do a better job explaining how the code should work than I can in a blog post, so I recommend checking them out: http://www.education.rec.ri.cmu.edu/pre ... 2_preview/

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Tue Nov 20, 2012 10:16 am
Profile
Rookie

Joined: Sun Nov 18, 2012 11:49 pm
Posts: 6
Post Re: Obstacle course----> line tracking
Thank you. My robot is now following the line correctly.I will review the videos about line tracking to understand it better. :-)


Fri Nov 23, 2012 4:25 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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:  
cron



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