HOWTO run Arduino on the XO Laptop

Technology

Xo-Arduino-Screenshot

The XO Laptop comes with the drivers you need to talk to an Arduino board, but you need to do a few things before you can run the Arduino environment. Once you get it running, though, it works just fine. The first step is to install Java. To install Java on the XO Laptop, check out these instructions (the version of Java that you download will be different from what’s listed on that page, so you’ll need to modify the commands slightly to take that into account).

Once you’ve got Java up and running, you need to install the GNU C and C++ compilers as well as the LIBC for the AVR chip that the Arduino uses. To do this, open up the Terminal activity, su to root, and install avr-gcc, avr-libc, and avr-gcc-c++ using yum:

$ su
# yum install avr-gcc avr-libc avr-gcc-c++

While you’re root, you may as well make one of the changes you need to make; add the olpc user to the lock and uucp groups. To do this, edit the /etc/group file with the /usr/sbin/vigr command and add the olpc user to the end of the lock group:

lock::54:olpc

and to the end of the uucp group:

uucp::14:uucp,olpc

After you exit vigr (which is just a script that starts vi to safely edit the group file), decline its offer to edit the gshadow file, and type exit to get back to a normal (non-root) shell):

# /usr/sbin/vigr
You are using shadow groups on this system.
Would you like to edit /etc/gshadow now [y/n]? n
# exit
exit
$

Next, make sure you’re in your home directory, download Arduino (there may be a more recent version of it, so check the Arduino page to be sure. Extract Arduino in your home directory (you’ll be running it out of your home directory as well):

$ cd
$ wget http://www.arduino.cc/files/arduino-0010-linux.tgz
$ tar xvfz arduino-0010-linux.tgz

Now, you’re all Arduino-fied. To run it, cd to the arduino-0010 and run the arduino script:

$ cd ~/arduino-0010
$ ./arduino

There is one last trick: you’ll likely find that the Arduino user interface misbehaves quite a bit. To get it to work right, press the screen rotate button four times to get a nice 360 degree rotation. Arduino will redraw and start behaving itself as shown in the screenshot.

Update: As Seth points out in the comments, the Update.1 build that is coming out this month will do away with the su command, so you should use sudo -s instead of su (or simply prefix each superuser command with sudo).

Update 2: If you use JRE 5 from the Java technology archive instead of JRE 6, you won’t need to use the screen rotation trick. You’ll need to add these two lines to the .bashrc file in your home directory, and then stop and relaunch the Terminal activity:

export JAVA_HOME=/usr/java/jre1.5.0_13/
export PATH=$PATH:$JAVA_HOME/bin

You’ll need to install Java and modify your ~/.bashrc before you try running ./arduino

21 thoughts on “HOWTO run Arduino on the XO Laptop

  1. Anonymous says:

    Something I’ve been wanting for a while has been a small, lightly featured, keychain sized multimeter. I would really just be happy with getting a quick idea of the voltage and direction of current. I’ve toyed with the idea of just using a pancake motor, and judging the speed to get a quick and dirty estimate, but are there any preexisting keychain multimeters that I should look at?

  2. Links? says:

    This article could use some links.

    Links to the items, or links to the hacks, or links to Makezine/Hackzine articles about the hacks, etc.

    MakeFan:

  3. Jason Striegel says:

    MakeFan:
    What, you think this is the interweb or something? :)

    Links have been added. Please toss in any others that you think should be listed.

    -J

  4. Jason Striegel says:

    @comment #1:

    I searched a bit but didn’t see any keychain multimeters. The smallest I’ve seen are about the size of a stack of 5 credit cards. It’s a good idea, though. If you come up with something usable, please let us know.

  5. MakeFan: says:

    Ah, much better. Thanks.

Comments are closed.

Discuss this article with the rest of the community on our Discord server!
Tagged

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK