There are currently 0 users and 2 guests online.
Build Your Own Micro RC Surveillance Robot
2.3 Programming (Part 1)
Submitted by Canabots on February 1, 2009 - 7:35pm.
So if you decided to use the BS2 for transmitting the RC signals, you'll need to download the PBASIC 2.5 software for free from Parallax.com .
Open a new file and save it as anything you want. Copy the following code into the window and click "Run".
This is the test program I wrote for the robot to go forwards and back, and left and right for half second delays.
' RC Surveillance Robot Test Program. Change the length of delays (in milliseconds) and decide when you would like the robot to turn or change direction by modifying the following code.
PAUSE 500 ' Delay 500ms
LOOP ' Repeat
If you decided to use the PIC16F684, then follow the instructions to downloading MPLab IDE and Hi-Tech's PICC Lite Compiler.
After, go to "Project", and then "New Project". Name it what you want and choose a directory. Then, you will need to download all the files at the bottom of this page. Two of these are header files, the other two are C program files.
Next, make sure your project files window is open. Right click on the section called "Header Files" and add the files always.h and delay.h. Then, right click on "Source Files" and add the files delay.c and Transmitter.c.
Voila! Compile and program the code to you microcontroller. Turn on your circuit and your robot will do sequenced movements!!!
In the third and final part of this tutorial, I will demonstrate how you can implement basic teleoperation onto you Micro RC Surveillance Robot!