Arduino

From ArchWiki

Jump to: navigation, search

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

If you have a 64 bit Arch this page is an alternative tested method of installing Arduino which works on version 17.

More information is availible on the Arduino HomePage.

Contents

Install packages from official repositories

Install the avr-libc, avrdude, binutils-avr and gcc-avr packages from community.

pacman -S avr-libc avrdude binutils-avr gcc-avr

Install ardunio package from AUR

Download arduino from the AUR and install it.

mkdir arduino_build && cd arduino_build &&
wget http://aur.archlinux.org/packages/arduino/arduino/PKGBUILD &&
makepkg -i

Running arduino for the first time

If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino will try and create it. Normal users don't have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created it can be run under a normal user.

Problems on x86_64

Arduino won't run on x86_64 as it tries to load a 32-bit library "/usr/share/arduino/lib/librxtxSerial.so". In order to upload code t

Other info

Accessing serial

The arduino board communicates with the PC via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. Udev creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.

gpasswd -a <user> uucp

Using a Makefile instead of the IDE

Instead of using the arduino IDE it's possible to use another editor and a Makefile.

Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from arduino website or from /usr/share/arduino/hardware/cores/arduino/Makefile

You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.

PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into
TARGET = your sketch's name
ARDUINO = /usr/share/arduino/lib/targets/arduino

Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.

Now you should be able to make && make upload to your board to execute your sketch.

References

Personal tools