Is there any better toy then Lego? I don't know. Oh, I know what your are saying, Lego's are for children. Well not when you add a microprocessor! The Lego Mindstorm is a great way to get started But I wanted to show you why.
With this project I took the lego mindstorm basic kit and the juiced it up. I replaced the OS with LegOS From there I can program using C instead of the default drag and drop OS that the mindstorm kit comes with.
The biggest improvement you get by using LegOS is that you get and "if" statement. Now I can make more complex statements and use the microprocessor to my advantage.
My project was a "hide and seek" robot. Having a five year old running around the house made this a worth while project. I built the base using the tracks. For sensors, I used used two of the straws on a pivot point to push the momentary switches for whiskers. I used the light sensor and pointed it up. The finished assembly is seen the the photograph.
Now came the programing. The LegOS can be written and compiled on Linux. Yes Linux, the OS that should rule the world ! The basics of the program was to build a bump and turn robot that would do this for a certain amount of time measured by the lego's internal timer. In this case it was 45 Sec. Once the time ran out it would keep moving until it hit the next object. This way it would not stop in the middle of the room. It would stop next to a wall or under a table or something like that. Sure this isn't too had to find but for a five year old this rules. Once it was there it would wait until the light sensor was lit up with a flash light thus telling the robot it was found. It would back up and spin to acknowldge it was found the then start the process all over again.
Using some simple easy to find software. I wrote and compiled and down loaded the code the the robot and I was off and running. The only question was who it entertained more me, the five year old or the cats. |