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.

Motor (and Sensor) Tip #0

Author: fllCoach | Files under Programming

As I was drafting a post about how to follow a line, it occurred to me that I have my team do something that helps to minimize confusion when programming. I was going to post it as tip #2, but realized it should have been the first tip I posted. So I’m labeling it as tip #0 which ties in with the fact that in computer programming, loops always start with 0 and not 1.

As your team puts your robot together, they’ll start to have a mess of wires leading from ports to motors and sensors that will look like a plate of spaghetti. Unless they hook them up logically, they will have to keep tracing wires to see what is hooked up to what.

You’ll notice that whenever you add a motor block to your program, the block defaults to using ports B and C for the motors. The designers of the NXT programming interface assumed you will be making the robot move. You can take advantage of this by hooking up your motors to ports B and C. That way, you won’t have to remember to change the ports whenever you add a new motor block.

You can take this one step further by attaching port B to the left motor and port C to the right motor. Port B on the brick is to the left of port C so by connecting the ports to the motors on the same side, your team will never have to think about which motor to move.

The same goes with sensors. Each sensor defaults to a certain port. The touch sensor defaults to port 1, the light sensor defaults to port 3, and the ultrasonic sensor defaults to port 4. If you connect each sensor to the port automatically selected by the programming interface, you’ll never have to remember to change the port and wonder why the sensor isn’t working when (not if) you forget.

Naturally, if you use more than one of any type of sensor, this becomes a little more difficult. But try to use the same methodology with multiple sensors of the same type as with the motors above. We have two light sensors on our robot, so we connected the one on the left to port 2 and the one on the right to port 3. Port 2 was the only port that wasn’t being used as a default for any of the sensors we were using and port 2 is to the left of port 3 on the brick. This makes it easy to remember which port is connected to which sensor.

You can, of course, use any port to connect to any motor or sensor you want. But when you’re in the heat of programming, you want to concentrate on programming and not be distracted by trying to remember what is connected to where. It adds a level of complexity that isn’t necessary. Keep it simple and logical and your team will be able to stay focused on programming and not on tracing wires.

2 Trackback(s)

  1. Nov 4, 2010: Following a Line – The Program | Lego League Coaching
  2. Aug 31, 2012: How to Use this Site | Lego League Coaching

Post a Comment