banner I have been a Lego League coach since 2007. This year, I wanted to document the season to give rookie coaches a resource to help them through to competition. The process can be intense, but it can also be a lot of fun for you and your team.

I hope to cover enough through my posts, but if I leave anything out, please feel free to leave a comment, or contact me.

See What the Robot Sees

Author: fllCoach | Files under Programming

One of the really useful features of your NXT brick is the View. It allows you to see what the robot sees. This especially comes in handy with the sensors. You can see how many degrees the robot needs to move, see what the light sensor is detecting, or see the distances the ultrasonic sensor is calculating. It saves a lot of trial and error.

To get to the View, turn on your brick with the orange button and press the right arrow button three times.

Click the orange button to select. Then use the arrow buttons to select the sensor you are interested in. For this example, select the Motor Degrees sensor.

Then select the port the motor is attached to.

Now when you move the motor, it will measure how many degrees it is moving.

When it moves backwards, it will show a negative number.

Experiment with the different sensors to see what effect the different sensors have. There is one important caveat, though, with the View that I will write about tomorrow.

4 responses. Wanna say something?

  1. Dean Hystad
    Oct 25, 2010 at 13:32:05

    This is kind of true. There are some caveats

    Rottion sensor
    For NXT V2.0 software and above the rotation sensor block returns a signed number. Earlier versions of the software returned an unsigned value and you had to look at the direction output to determine which direction the motor turned.

    The sign of the rotation sensor does not indicate forward and backward, just that the motor is turning one direction or the other. How you build your robot determines is a positive rotation makes the robot drive forward.

    Light Sensor
    I think this is the topic for tomorrow.

  2. fllCoach
    Oct 26, 2010 at 10:41:19

    Thank you for pointing that out, Dean. I made an assumption that the robot was designed for the positive rotations to be “forward.”

    In fact, our team had attached the motors backward and we decided to fix them because having to think opposite to what you expect added a level of complexity that was unnecessary.

  3. Dean Hystad
    Oct 26, 2010 at 12:52:02

    A good reason to wrap the Move block in your own MyBlock. You can isolate your programs from issues like direction. You can also do things like make A and C the drive motors instead of B and C. Or have the robot drive forward if the duration is positive and backward if the duration is negative (instead of seperate duration and direction settings).

    My girls used their Move block wrapper to convert the duration input from motor degrees to millimeters. Just last week they taught MyBlocks to the team they are mentoring. Their example? A move block that takes duration specified in inches.

    A similar wrapper around the Motor block makes it so you don’t have to remember which port the arm motor uses, and which direction makes the arme go up.

1 Trackback(s)

  1. Oct 25, 2010: View Caveat: The Light Sensor | Lego League Coaching

Post a Comment