Showing posts with label mindstorms nxt. Show all posts
Showing posts with label mindstorms nxt. Show all posts

Saturday, February 21, 2009

Tag bot


I really like this robot because it is the first robot I programed to play a game. This robot goes forward until it senses an object. Then it goes backwards. If it does not sense an object for three seconds, it turns and goes in a new direction. As this is going on, you try to tag the robot's light sensor with a beam of light from a flashlight. When you tag the robot, the robot makes a beeping noise. If you tag the robot for a half a second, it will stop then say "game over".

Here's what the code looks like:



Wednesday, January 21, 2009

Edge finder

When you put the edge finder in the middle of the table, it moves forward until it finds the table edge (using the ultrasonic sensor). Then it moves in reverse to the center of the table, then it turns randomly, and repeats that two more times. The ultrasonic sensor works by sending out a very hi pitched sound that you can't hear. Then the sensor times how long the sound takes to get to an object in front of it and back.





Here's what the program looks like: