Arduino

From openSUSE

Contents

Arduino

Introduction

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. This page is how to run the Arduino Development environment on openSUSE. Note that this can then be used to program official Arduino boards, or Arduino-compatible (such as Freeduino, Boarduino)

Requirement

The following packages are required to run the Arduino IDE:

  1. java-1.5.0-sun
  2. cross-avr-gcc
  3. cross-avr-binutils
  4. avr-libc
NOTE: If you are running non-recent versions of openSUSE you will need to ensure that cross-avr-gcc includes avr-g++ (eg for SUSE 10.0 get avr files from here)


Set up the Arduino IDE

Download and extract the IDE from here.

In the arduino/tools directory, make symlinks:

 ln -s /opt/cross/bin/avr-gcc avr-gcc
 ln -s /opt/cross/bin/avr-g++ avr-g++
 ln -s /opt/cross/bin/avr-objcopy avr-objcopy
 ln -s /opt/cross/bin/avr-objdump avr-objdump
 ln -s /opt/cross/bin/avr-size avr-size

Make /var/lock writable by your user:

 chmod 777 /var/lock

Make sure the permissions on /dev/ttyUSB0 allow you to read from it and write to it - as root, run:

 chmod 777 /dev/ttyUSB0

or alternatively add your user to the uucp group.

Launch Arduino. When running, from the menu selectTools->Board in this example we used Arduino Decimilia which is a USB board, and in Tools->Serial Port select /dev/ttyUSB0.

These preferences are written to ~/arduino/preferences.txt, and this file can be edited manually as well as through the IDE. However, ensure that the IDE is not open when you do this, or it will overwrite your changes when you close it.

Running a test program

Open File -> Sketchbook -> Examples ->Blink.

Press the Upload to I/O Board button in the IDE. You should see the TX and RX lights on the board flashing as the upload is made.

You should get a message similar to the following:

Binary sketch size: 1106 bytes (of a 14336 byte maximum)

After a couple of seconds the program will start running, and the LED on the board connected to Pin 13 will begin to flash on and off.

Troubleshooting

Ensure ftdi_sio and usbserial modules are loaded. If not, as root, run:

 modprobe ftdi_sio
 modprobe usbserial