These instructions are for setting up an Arduino and alamode friendly environment on the Pi. Gathered from many sources (see earlier posts) and updated with the latest info.
Download and install Linux Image
Download the Black Raspberry Distribution from Adafruit:
DIrect link to the current (0.2 version):
Burn to your favorite sd card. Helpful tips at:
If you need to set up Wifi, or other things, follow the instructions at the first link above.
Configure your keyboard and Timezone
It’s difficult to edit config files when the quote key produces a different symbol.
Unless you are in or have a Great Britain keyboard, you’ll need to:
sudo dpkg-reconfigure tzdata
Serial Port configuration
AlaMode can communicate via the UART pins of the GPIO connector. Unfortunately, for now, the Arduino IDE doesn’t recognize the device name /dev/ttyAMA0, so you’ll need to create an alias. By the way, it also doesn’t recognize the Arduino UNO (/dev/ttyACM0) so you can handle this the same way.
sudo vi /etc/udev/rules.d/80-alamode-rules
Next, disable logging messages:
This bit disables logging to the GPIO UART, so if you are using an Arduino via USB, it’s not necessary.
dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
deleting the two parameters involving the serial port /dev/ttyAM0
You also have to edit /etc/innitab to remove the login (getty)
Installing the Arduino IDE
Before getting any of the other packages:
The IDE is written in Java (based on Processing) and while Oracle doesn’t have an official Java for the ARM core in the Pi, the Open JDK has been ported. It doesn’t have a JIT (Just In Time Compiler) so it’s a little slower, but it works.
First grab the Arduino IDE code. 1.01 is heavily entwined with the native GCC toolchain, so is a lot more work and not recommended. For now, stick with 1.0.
tar zxvf arduino-1.0-linux64.tgz
The Arduino IDE is written in Java, but there are native parts to do compilation for the atmega328p microcontroller. Fortunately those have also been ported:
sudo apt-get install libftdi1
sudo apt-get install avrdude
And then copy the native stuff into the Arduino directory:
for i in $(find . -name “librxtxSerial.so”) ; do cp /usr/lib/jni/librxtxSerial.so $i ; done
for i in $(find . -name “RXTXcomm.jar”) ; do cp /usr/share/java/RXTXcomm.jar $i ; done
cp /usr/bin/avrdude /home/pi/arduino-1.0/hardware/tools/avrdude
cp /etc/avrdude.conf /home/pi/arduino-1.0/hardware/tools/avrdude.conf
And probably reboot again, and then you should be good to go! Contact me on Google + and let me know how it goes!