Wednesday, January 14, 2009

LucyLeia

So yesterday after posting on Luke, I broke him down and built up a new Robot: LucyLeia. Her purpose in life is to sort 1x2 Lego bricks by color. Depending on the color depends on which side she puts them on and what sound she makes.

Here is the main component of her. On the top is the motor, which moves her arm. The next brick with the wire, down is the touch sensor, which allows her to figure out where the holes are in the arm to all the Lego bricks to slide through the arm and move them to one side of her or another. The bottom wire in the picture is the light sensor. It is this sensor that allows her to figure out which color the brick is. The light sensor has a red LED that provides constant light, so by making the dark tunnel, the light sensor readings should be pretty close each time.

Here she is on her stand which allows the bricks to slide down, hit the light sensor, which activates code to move her arm and make the right noise.





Here is a video of her in action. (Make sure that the volume is on so that you can hear her make noise) ;-)




The coding of LucyLeia was in NQC. One of the interesting things about her code that I found, was that Baum took advantage of the NQC code and used "toggle" to move the arm in the opposite direction, after it had dropped the Lego. Because I ran into problems with some of the 1x2 bricks in the Mindstorms set, because of holes, I brought some of my own in. This provided me with the opportunity to use more than two colors of bricks. To see if LucyLeia could tell the colors a part, I programmed her to make certain sounds, depending on the color of the brick.

Time worked since last post: 2 hours 30 minutes
Overall: 26 hours 50 minutes

0 comments:

Blogger Templates by OurBlogTemplates.com 2007