Documents » Pololu 3pi Robot User's Guide » 6. Programming Your 3pi »6.b. Compiling a Simple ProgramA very simple demo program for the 3pi is available in the folder
#include <pololu/3pi.h>
int main()
{
print("Hello!");
play("L16 ceg>c");
while(1)
{
red_led(0);
green_led(1);
delay_ms(100);
red_led(1);
green_led(0);
delay_ms(100);
}
return 0;
}
Navigate to the
To compile this program, select Build > Build or press F7. Look for warnings and errors (indicated by yellow and red dots) in the output displayed below. If the program compiles successfully, the message “Build succeeded with 0 Warnings…” will appear at the end of the output, and a file
Connect your programmer to your computer and to the ISP port of your 3pi, and turn on the 3pi’s power by pressing the button labeled POWER. If you are using the Pololu Orangutan Programmer, the green status LED close to the USB connector should be on, while the other two LEDs should be off, indicating that the programmer is ready. Your programmer must be installed correctly before you use it. If you are using the Orangutan USB programmer, please see its user’s guide for installation instructions.
Select Tools > Program AVR > Connect to connect to the programmer. For the Orangutan Programmer, the default options of “STK500 or AVRISP” and “Auto” should be fine, so click Connect and the AVRISP programming window should appear. You will use AVRISP to load
If your 3pi was successfully programmed, you should hear a short tune, see the message “Hello!” on the LCD, and the LEDs on the board should blink. If you hear the tune and see the lights flashing, but nothing appears on the LCD, make sure that the LCD is correctly plugged in to the 3pi, and try adjusting the contrast using the small potentiometer on the underside of the 3pi, closest to the ball caster. |
|
Home
|
Contact
|
About
|
Forum
|
Wish Lists
|
US toll free: 1-877-7-POLOLU |