LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

sensing aluminum foil, counting laps

Good Afternoon,
 
I am a middle school teacher and some of my students are working with the NXT Mindstorms kit.  Our task is to follow a black line around a course for 2 laps and stop on the start/finish line.  We spoke with other schools and were told the best strategy would be to have the robot follow the line and count/ detect each time it passes the foil. When it has detected the foil the 2nd time it should stop.
 
Well, they have successfully gotten it to follow the line (forever)  Their first idea was to time the robot for one lap, and run the motors long enough to complete 2 laps.  This has proven a little inconsistent.  So...
 
Our question is this: How do we get the light sensor to recognize and count a lap each time it senses the foil?  They have played with the sensor and when on white paper it indicates a "reflective #" between 48-54.  When the sensor is over the black line the "reflective #" is in the 30's; and when on the foil the sensor reads in the high 50s to low 60s.  We can see on the programming screen that there is an input for count, but it is ghosted over and we cannot change anything.  (we looked on the lego help pages, and there was something about a "data wire" but we did not know where or how to connect it.)
 
Any assistance you can offer would be greatly appreciated. 
I apologize in advance if this not the forum for this type of question.
 
Thanks very much
 
Dave T
 
 
0 Kudos
Message 1 of 2
(6,242 Views)
Hi,
 
I am far from an NXT expert, but here are two ideas.
 
1. When you open up the Light Sensor VI or Block, you notice at the bottom where you can set the thresholds?  Have you thought of setting up a loop (or nested loops) that contains Greater Than and Less Than values that oyu have measured for the White Background, Black Line and Al. foil?   It will take some thought on the part of your students, butI believe you can accomplis what you want this way.
 
2.  GoTo the string in this forum entitled " Teaching LabVIEW to engineering students: is the NXT Toolkit recommended? " There is a link to Labs that you can download , Lab 5 goes into the light sensor.
0 Kudos
Message 2 of 2
(6,231 Views)