For programming, we've been using Arduino, a microcontroller board that acts like a mini-computer with its own power source.
We used the Arduino UNO, but there's also the Leonardo, Lilypad (a circular platform), Nano, Yun, and many more. They offer different sizes, power sources, and functionality. |
I won't go into the nitty gritty specifics of the code, but it's a lot more straightforward. Assign a device (LED, sensor, motor) to a one of thirteen ports, and you can control under what circumstances the devices are powered through the Arduino.
Using a do-it-yourself Arduino kit with next to no instructions, we were able to put together a moving robot with four-wheel drive and an ultrasonic sensor that could execute various commands as given by the computer; move forward, move backward, turn right and left, rotate the sensor, and record distance via ultrasonic echoes.
All four motors are connected to the Arduino through the breadboard, as is the motor rotating the sensor on the right. |
Right now, the motors for the wheels are controlled by the computer; enter a positive value for moving forward, negative for reverse, and two other arbitrary variables for turning. Speed is controlled by the value entered: the higher it is, the faster the wheels move.
The circuit on the breadboard with the black chip is called an H-bridge, which can direct current in either direction. This is what allows the wheels to spin one way or the other. |
No comments:
Post a Comment