Installing Eclipse Europa
When you have downloaded the Eclipse install
package, you’ll see that it isn’t the friendly type of
Macintosh installer. It is a gnu zipped tarball. Not to
worry, your Mac can handle this package easily. Move
the install file to your Applications directory and double-click on it. After you double-click the install file, a couple
of windows will pop up and then go away. When those
are all done, you will have an Eclipse directory in your
Applications directory. Inside there you will find the
Eclipse program. You will want to have easy access to
this program if you do a lot with robotics, so drag the
Eclipse icon on to your dock next to your Terminal icon.
Installing the Eclipse AVR Plug-in
We have two ways we can install the AVR plug-in.
One is to take the file that we’ve just downloaded and
unzip it in the Eclipse directory by moving the file to the
Eclipse directory and double-clicking on it. This is the direct,
brute force method. If you have Eclipse running, then
restart it after you unzip the file.
The second way is for you to use Eclipse itself to install
the plug-in. Since you’ve just seen the brute force method —
which is easy, let’s look at the elegant way — through the
Eclipse IDE. Click on the Eclipse globe on your dock (you did
put it there, right?) and wait for it to start. When it first
comes up, you will see the screen shown in Figure 3 asking
you where to put the workspace files. It usually wants to
put them in the Documents folder; I have no objection,
so just press OK.
Next, navigate to Help-> Software Updates -> Find and
Install as shown in Figure 4 to get to the Feature Updates
dialog and click the Search for new features to install
button, then click Next. Click the New Remote Site button
and fill in the dialog box as shown in Figure 5.
There are lots of Next, Finish, and I Accept type of
buttons to push; remember to actually select the plug-in
when you see its checkbox on the screen! When you have
navigated this endless selection of screens, licenses, and
warnings about unsigned downloads and hit your final
finish button, you will see the window as in Figure 6.
Whew! Now restart Eclipse and let’s get to work!
Figure 2. Avr-gcc configure example.
Figure 3. Workspace dialog.
Figure 4. Get a plug-in.
Using avr-gcc, Eclipse, and the
AVR plug-in to write your code
I’ve written a toy program that blinks some LEDs on
one of my educational robot boards. All this program will
do is blink two LEDs alternately. This article isn’t about how
to write AVR programs — you can learn that anywhere (if
enough ask, I’ll be happy to write such an article) — but
how to use this set of tools on your Mac to do it, so I’m
not going to explain the code beyond using the tools to
write, compile, and download it. Now, let’s create an AVR
Creating a Project
Navigate the File -> New -> C Project and fill in the
Project name as
shown in Figure 7.
Note that the AVR
chosen. We’ll use
just that; press Figure 5. Install the AVR plug-in.
Next to set
everything up. You will get a configurations screen that
shows a Debug and RELEASE configuration. We’ll take the
defaults, but before we’re done here, click the Advanced
Settings button so that we can choose our processor and
clock speed. This window will look like Figure 8.
SERVO 08.2008 21