From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Mindstorm light sensors

i would like to know is there any way to get the input from the mindstorm light sensor and display it on the LCD??

 

i am using nxt 2.0

 

example... i will write the number "1" on a piece of paper and would like this 1 be display on the LCD of the processor when the robot's light sensor scan this "1"

 

below is my code:

 

task main() {
 SetSensorLight(IN_1);
 int light=0;
       light=Sensor(IN_1) ;
     ClearScreen();
     ResetScreen();
            NumOut(0,0,light);

 Wait(20000);

Off(OUT_AC); // stop and end program gracefully
StopAllTasks();
}

 the result of the above code is that no matter what i write on the paper... the LCD will keep displaying 100

0 Kudos
Message 1 of 2
(5,516 Views)

in addition to my post above.... can NXT 2.0 do character recognition?? 

 

i.e like making the robot play the word search game... can any kind soul able to point me to a guide or tutorial on achieving my goal?

0 Kudos
Message 2 of 2
(5,514 Views)