View Single Post
  #1   Spotlight this post!  
Unread 21-02-2012, 20:16
eovnu87435ds eovnu87435ds is offline
Registered User
FRC #0087
 
Join Date: Jan 2010
Location: Mt. Holly NJ
Posts: 19
eovnu87435ds has a spectacular aura abouteovnu87435ds has a spectacular aura abouteovnu87435ds has a spectacular aura about
NXT Light Tracking

Hey, can anybody help me figure this out? If there is a light source that is, say 7 ft away from a NXT bot with a light sensor, and my goal is to move towards it, how do I get there? I know that I can have the robot move in a circle until it finds a value higher than 50 or so, but when the robot is at 7ft, it reads 50, and as it moves closer it goes up to 90. What would be the best way to get to that light source?

In psuedo code I was thinking this, but Im not sure if its possible or even if it is the best way, but here is what im thinking.
Code:
left motor val=60
right motor val=75
read light sensor. the value should eventually rise until it passes infront of the light, and then it starts falling
when the light value starts going lower than that highest point, 
left motor val=75
right motor val= 60
That should have some sort of snake like pattern that the robot should follow towards the light.

How can I make that work in LabVIEW?

Thanks,

Mike
Reply With Quote