Page 1 of 1

First Year Lego Body Forward Team

Posted: 02 Dec 2010, 02:38
by mattanders
Im coaching a team of youngsters for a Lego First, Body Forward Robotics team for the first time. We have all our research completed and several missions that work perfectly.
We have two questions about programming that we are having a hard time finding a solution to.

!. When we create a loop, add a switch with a light sensor and add four move blocks so the robot will track a line it works using time but we can’t get the counter to work. The directions tell us to check the count box; this opens a plug on the left side on the loop. We are supposed to connect a wire to the right side of the loop at the plug. This is where we are having problems. It looks like we followed the directions but the program wont count the number of switches.

2. We are using a color sensor that that we got from a friend. It didn’t come in our kit. We are trying to get the color sensor the react when it passes a black square and not when it passes a white square. Our program should send the robot down the right side of the mission board. When it sees the black square it should stop the drive motors and start the A motor that runs a worm gear and sends a leaver out and back. Than the robot moves to the next black square, stops the drive wheels, activates the leaver and runs out and back. Using the help menu there is very limited help for the color sensor.

Any help would be greatly apprishratred. Thanks for taking the time to read this.
Just in case my email is [email protected]. I can’t post to this web site during the day it’s blocked at work.

Re: First Year Lego Body Forward Team

Posted: 05 Dec 2010, 01:20
by tgriffin62
Hi Matt,

1. To make the loop repeat a certain number of times you should set the Control item to Count. Once you do that a box will appear that lets you enter the number of times to repeat. The Show Counter check box just adds a data hub which you can use if you want to do some calculations involving the number of times the loop has run.

2. If you have the LEGO Color Sensor you'll need to use one of the more recent software versions. What version are you using? You should be able to distinguish between black and white using the sensor either in Color Sensor or Light Sensor mode. And if black and white are the only two colors you're interested in then a Light Sensor should work just as well.

Terry Griffin

Re: First Year Lego Body Forward Team

Posted: 07 Dec 2010, 01:38
by mattanders
Terry,

We are using the latest software; I think its NXT 2.1 with the latest firm ware.

The kids got the color sensor to work when detecting white panels. But they need the robot to detect a black panel.

The problem is that when the robot is moving down to where the white and black panels are the light sensor is reading a very low value. It can’t distinguish between nothing and a black panel. If the challenge was to identify the white panels that would be easy. When the robot is moving down the board the color sensor reads a very low light value. When the robot passes by the white panel it gets a high reflected value and activates the A motor to flip the panels.

Can you offer any recommendations?

Thanks Matt and the kids

Re: First Year Lego Body Forward Team

Posted: 07 Dec 2010, 23:30
by tgriffin62
Hi Matt,

To increase the contrast between the black square and the background you can try mounting the sensor very close to the floor. This helps it detect more of the reflected light.
With the Color Sensor you can pick which light to use (Red, Green, or Blue). Try each one and see what gives you the best chance of telling the black from the background.

Terry Griffin