you can give to your robot the capability
to read a bar code and perform some operation according to the value of the code
Bar code reader is written in the NXT-G environment to
give to everyone the possibility to use it in its project.
Following these simple steps you can realize
your own barcode driven robot!
- Equip your explorer robot with the light sensor
pointed to the floor to a distance of 1,0 -1,5 cm from it (see
close up in gallery).
- Download the
block and save it under your my blocks directory
(usually C:\Documents and Settings\<your user name>\Documents\LEGO Creations\MINDSTORMS
- Download the
file containing the bar code and print them or make your own barcodes
following these simple
- Make your project using the
block with input in NumOfBar plug of number of black
strips of your code -1. If you use the
file downloaded from this site, the
right value is 5. Read the page
for furter informations.
- Optionally, you can
sample project (remember to copy the BarCodeReader
block in the right position -see step 2)
In this case remember that the right sheet to use is the one labeled 23-30.
- A black bar is recognized if the ligth sensor read a
value < 45. A Value >=45 is interpreted as a white bar. Before launch the
program place the light sensor of the robot in a black and in a white area.
If the black value or the white area are near to the trigger value of 45
take the right action:
- move the light sensor a litlle up or down;
make a more darker print of the barcode;
-change the trigger value by
editing the barcode.rbt block. (Advanced user only).
forget to e-mail your impression for