Myself and a bunch of other people waited patiently outside the The Village @ NAB (an awesome space by the way) until the friendly security staff would let us in the doors a little before 10am. The checkin process was easy, and before we new it @dtbolger and I had our Robo Hacker Kits and were checking out all the wires, plastic pieces, and electronics (including an arduino nano) we had. I don't know about everyone else, but I had absolutely no idea to where to start.
Luckily, by the time I got to that point @ajfisher gave a very nice intro to the day, and then Hadi gave a great presentation on getting started with electronics which I found very useful.
I then went back to my laptop and cloned the simplebot repository locally and quickly realised I had no idea how to perform the "Flashing my arduino" step. One of the experienced mentors helped us out by pointing us at the Arduino app (which we already had installed). The steps that were required were:
- Open Arduino
- Menu -> File -> Open
- Browse to the simplebot repo that you cloned earlier and select the file SimpleBotFirmata/SimpleBotFirmata.ino
- Click Open
- Menu -> Tools -> Board -> Arduino Nano (I had 2 options and had to select the w/ ATmega328)
- Plug the Arduino into your USB port if you haven't already
- Menu -> Tools -> Serial Port -> /dev/tty.usbserial.XXXX
- Click the Tick button in your SimpleBotFirmata Arduino window
- Click the Right Arrow button right beside the Tick button once the compile is completed
The first thing I noticed that one of my servos worked and the other didn't. After a bit of head scratching, I found that I had plugged the servos into the pins d8 and d9, yet in the simplebot.js file I was referring to pins d9 and d10:
So I moved the wiring on the breadboard so I was connected to pins 9 and 10 and everything worked perfectly! Needless to say, I was pretty excited at this point, now I just had to strap the simplebot together and get it running all over the floor.var left_wheel = new five.Servo({ pin: 9, type: 'continuous' }).to(LSTOPVAL);var right_wheel = new five.Servo({ pin: 10, type: 'continuous' }).to(RSTOPVAL);
The next thing that confused me was how to hook the wheels up to the servo. What was needed was to cut 4 lengths (15-20cm) from the wire included in your kit, and thread them around another bit of plastic and the wheel (similar to threading a button), until it looks something like:
I set up the rest of the board until it looked like so:
I plugged in the battery pack, attached the wheels, and I was off and racing. One thing I'd recommend, is that you attach the nub/dome thing at the front (underneath the base at the bottom end of previous picture) before sticking the breadboard to the base. I didn't, and my breadboard was partially covering the hole I needed to use to screw the nub/dome to the base board.
I extended my bot slightly by using the ultrasonic sensor to stop the simplebot if it got closer than 20cm to an object. I also added an emergency retreat that would cause the bot to back away if it was closer than 5cm to anything. This was a bit of fun, but meant that my simplebot was terrible at soccer as it kept running away from the ball :-D
No comments:
New comments are not allowed.