loading

Step 10: Programming

The Pingbot is not much more than a remote controlled puppet. It doesn't have any sensors and it can't track its own movement. It only does what the remote tells it to do. Because of this the program is limited in its options and uses only a few basic commands and some semi-tricky dance moves. I am not very experienced with programming these chips and I'm certain there are functions that I am unaware of. What little programming I have learned was from the PixAxe manuals and their website.

Software
PicAxe Programming Editor, the software used to program the 08M2, is available FREE from the PicAxe website.

Serial Programming
To program a PicAxe chip via a USB port an AXE027 programming cable is needed. While designing the circuit I was working under the assumption that the 08M2 could be programmed with a direct connection to the USB port's data+ and data- pins. I thought I could skip the 027,  and would need only the Micro-USB connector to program the chip. After a few failed attempts at uploading the program to the bot, I did some testing/research and found out that the AXE027 cable contains a serial converter. I don't know the exact details of how this converter works, but It is necessary to program the PicAxe over a USB port.

It was far too late to go back and fix this in the design, everything had already been put together! Besides, there wasn't room to add a stereo jack for the AXE027 onto the circuit board. To program the chip I needed to make an adapter that could receive the stereo jack from the AXE027 and connect it to the Micro-USB cable.

I rummaged through my box of computer stuff and found a PS2 -USB adapter that I was not emotionally attached to. I cut it apart, removed the female USB connector, and wired that to a 3.5 stereo jack that I had left over from a previous project. The accompanying image details how this adapter was wired.

What the Program Does
The robot is controlled by a standard universal tv remote that I got for $5. The remote is set to the Sony television code, which is what the 08M2 is able to decode. When a button is pressed on the remote it transmits a code from its infrared LED. Meanwhile the 08M2 has been waiting for its IR receiver to pick up this transmission, and when it does it stores the corresponding button number into a variable. The PicAxe  checks that variable and runs the code that is associated with the received number. The program then returns to its start and waits for another command.

The 08M2s tune command is awesome. There are thousands of free, old cell phone ringtones that were made to be played on peizo speakers and these can be downloaded and programmed onto the chip. Inserting these songs is as simple as using the PicAxe Programming Editor's ringtone wizard to import the songs into the code. Each note of the song is represented by a number and they can be copied, pasted, and re-arranged to edit the songs. The command also has options for blinking an LED (the eyes) with the music.

I programmed a few of the buttons with songs, and a few others with random beeps. The beeps give the robot some cut little expressions that are fun to use when it bumps into things and such. More info on the tune command can be found here. This page was also very useful, as it shows what code# is used for which remote control buttons.

When one of the Volume + - or Channel + buttons is pressed the program turns on the appropriate motor for 100 milliseconds, then turns it off again. If that button is held down that bit of code repeats, effectively turning the motor fully on. The LED eyes are tied to this same button so that they turn on in synch with the motor. The eyes do blink each time the code repeats, but the motors do not stop long enough to affect movement.

Dancing Robots Have More Fun
The Pingbot can be programmed with dance routines using a mix of the tune command and motor control . The program turns on a motor (or both), plays a few notes, and then turns the motor off. Next the opposite motor is turned on, the next set of notes in the song are played, and the motor is turned off. When these moves are executed together there is no hesitation between the commands and the song plays seamlessly while the robot whirls around in different directions. This can be seen in the video on this Instructable's intro page.
<p>Superior...!!<br></p>
<p>Really good...!!</p>
<p>The first road I would try would be to add a sound sensor.</p>
<p>Terrific</p>
<p>Good</p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>Its tremendous</p>
<p>Its tremendous</p>
<p>The first road I would try would be to add a sound sensor. Then you could set up 3 IR/Sound beacons in a room. The robot would receive a light and sound signal from the beacon and measure the time between the IR and audio to determine distance.</p><p>www.bosswallpapers.com</p>
saya sudah mebuat ini tetapi saya bingung bagai mana cara nya saya untuk memasukan data program dan bisakah saya minta data untuk memprogram pingbot? makasih
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>ean man i wish i had one</p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>Its tremendous<br><br></p>
<p>'m not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>GOOD</p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>ean man i wish i had one</p>
<p>GOOD</p>
clean man i wish i had one
clean man i wish i had one
well
great
thanks for sharing
thanks for sharing
clean man i wish i had one
Thank you Jenson that's great to hear :D <br>The idea came from all over the place. For the look of the robot, the movie &quot;Batteries Not Included&quot; had a major influence.
Its cold
nice this post
interesting
good one
awesome
amazing
I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes
nice one
Thank you Jenson that's great to hear :D <br>The idea came from all over the place. For the look of the robot, the movie &quot;Batteries Not Included&quot; had a major influence.
interesting
I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.
That's great one
good one
However, the kit bundle version should be available soon;
when suggesting scavenging from old appliances a picture of the component would be nice if only to save us some time.
that is so cool is this going to be on the market or is there even a need for this?
I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes. <br> <br>As for marketing, well, I'm learning about the process, but I'm certain that this will never be made into toy that your going to find at the store. However, the kit bundle version should be available soon; it has been submitted to Club Jameco and is making the final rounds now. <br> <br>Thanks for checking out the project, happy you liked it :)
yeah I thought it was neat
that looks AWESOME, Where did the idea come from?
Thank you Jenson that's great to hear :D <br>The idea came from all over the place. For the look of the robot, the movie &quot;Batteries Not Included&quot; had a major influence. As for the actual robot, I'd seen several of these little picaxe robots, such as the one by Mikey77 here on instructables, and wanted to make one of my own as a way to learn Picaxe and li-po battery charging.
These are great. Instead of remote control does anybody have ideas on how to make something like this autonomous so that it would move to a specified location or to a homing beacon?
Thanks Wrecks. <br>The first road I would try would be to add a sound sensor. Then you could set up 3 IR/Sound beacons in a room. The robot would receive a light and sound signal from the beacon and measure the time between the IR and audio to determine distance. After getting this info from all three beacons the bot could then triangulate its position. <br> <br>In theory anyway. I personally don't quite have the skills to tell you exactly how to do this, and I'm not sure if a PICaxe chip would be able to handle it. I bet an Arduino/Atmell would though. <br> <br>Another possibility would be to use a GPS sensor. It would be a little big to fit into a robot this size, but those sensors seem to get smaller everyday. <br> <br>Hope this helps and thanks again for the interest :D

About This Instructable

49,419 views

315 favorites

License:

Bio: When I was young I took all of my toys apart just to see inside. Eventually I learned how to put them back together.
More by Tomdf: Star Trek Doorbell Hack Sculpting with Polymer Clay Gear Set for 3D Printing
Add instructable to: