Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!


This week I am going to show you how to get up and running with the 3pi by Pololu. I will be going through all the steps needed to upload the line following program that is included from Pololu. Getting started with the 3pi isn’t too difficult, but there are a few applications and drivers that need to be installed.

Note: In this tutorial I will be using a PC running Vista. You can program the 3pi on a Mac running OSX or Linux, but it’s a different procedure. You can even program the 3pi through the Arduino IDE!

IMG_7154.JPG

What you need:

Optional Items:

Part 1: Setting up the 3pi

IMG_7133.JPG

Unpack and add the 4 AAA batteries. You need to remove the LCD to insert (2) of the (4) batteries. Just carefully lift it up and it will come off easily.

IMG_7136.JPG

Replace the LCD and press the power button. The 3pi comes with a demo program already installed. It goes over several different features of the 3pi.

Part 2: Downloading & installing custom programs

ScreenShot003.jpg

Start by downloading the Orangutan USB Programmer drivers. Follow the installation instructions. The installer takes care of everything.

ScreenShot010.jpg

Download and instal WinAVR. This is a set of free open-source tools for programming Atmel AVR series (or RISC) microprocessors. Follow the installation instructions.

ScreenShot013.jpg

Next, download Atmel’s free ARV Studio. This is the integrated development environment (IDE) that we will use to program the 3pi. Follow the installation instructions.

Finally download and install the Pololu C/C++ AVR Library. Extract all the files somewhere convenient.

Part 3: Installing the libraries

pololu a How to Tuesday: Getting started with the 3pi

Inside new folder called “libpololu-avr” is a file called “libpololu.a”. Copy that file over to the “lib” subdirectory of the “avr” directory found inside the WinAVR folder. (C:\WinAVR-20080610\avr\lib)

Note: Make sure you copy the “libpololu.a” file in thecorrect “lib” directory. It should go in C:\WinAVR-20081205\avr\lib NOT C:\WinAVR-20081205\lib.

wholefolder How to Tuesday: Getting started with the 3pi

Next, copy the entire “pololu” folder into the “include” subdirectory of your “avr” directory. (C:\WinAVR-20080610\avr\include\pololu)

Now you are all ready to start programming your 3pi.

Part 4: Uploading code

example How to Tuesday: Getting started with the 3pi

In the Pololu folder there is a subfolder called “examples”. Open that folder and you will find a line follower example program. Click on the “test” file in the “3pi-linefollower” folder and WinAVR should start loading.

build How to Tuesday: Getting started with the 3pi

To compile the program, click “Build” (F7) and check to see that the code is OK. If there are errors you will find them on the bottom of the screen. They will be highlighted with a red dot.

If everything compiles OK, it’s time to upload the file to the 3pi.

IMG_7147.JPG

Connect your Orangutan programmer to the 3pi and press the power button.

ScreenShot020.jpg

Select “Program AVR” and click on “Connect”. Select “STK500 or AVRISP” and “Auto” AVR Studio should open a new window called “AVRISP in ISP mode with ATmega168″. In that window click on the “…” button in the “Flash” section. Select the “test.hex” file that can be found inside the demo line follow folder. Now you can click “Program in the “Flash” section and the code should upload to the 3pi.

Part 4: Making a course

Making a course is easy. Just use some electrical tape on a large piece of paper. Set the 3pi down on the line and press the power button. Now press the “B” button twice and watch the 3pi go!


Suscribe to the MAKE podcast
| Download for iTunes

Makershedsmall

MKPO1-12.jpg

Pololu 3pi Robot

Marc de Vinck

I’m currently working full time as the Dexter F. Baker Professor of Practice in Creativity in the Masters of Engineering in Technical Entrepreneurship Program at Lehigh University. I’m also an avid product designer, kit maker, author, father, tinkerer, and member of the MAKE Technical Advisory board.


Related
blog comments powered by Disqus

Related Supplies at Maker Shed

Follow

Get every new post delivered to your Inbox.

Join 26,247 other followers