...

Arduino - Software


Setting up Arduino on Ubuntu:

I had originally installed the Arduino IDE (0022) using synaptic. It installed the Arduino stuff in:

/usr/share/arduino
and there was a shell script to fire it off, in
/usr/bin/arduino

I started seeing some issues with libraries I was including, like "...could not find Arduino.h...". So decided to upgrade to the latest version (1.0). Downloaded that from arduino.cc, and extracted a arduino1.0 directory. I wanted to still fire it like the previous synaptic install had done, so i could find arduino from the Dash bar, so just replaced the contents of the previous arduino folder with the contents from this new ardino1.0 directory.
Then typing in "arduino" from the Dash bar fired up the new version of Arduino.

Contents of the arduino start up script (/usr/bin/ardunio):

#!/bin/sh
 
APPDIR=/usr/share/arduino

cd $APPDIR
 
for LIB in \
    lib/*.jar \
    ;
do
    CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH

LD_LIBRARY_PATH="/usr/lib/jni${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base

Arduino Datatypes

Typebytesrange
int (int16_t)2-32768 to 32767
unsigned int (uint16_t, word)20 to 65535
long (int32_t)4-2147483648 to 2147483647
unsigned long (uint32_t)40 to 4294967295
float43.4028235E+38 to -3.4028235E+38
double4(same as float)
boolean1false(0) or true(1)
char (int8_t)1-128 to 127
byte (uint8_t, unsigned char)10 to 255

Setting up the Arduino on Linux

To interact with the Arduino, it might be required for the logged in user ($ whoami) to have permissions to the serial device.
$ groups # The user needs to belong to the same group as /dev/ttyS0, which is typically "dialout". 
$ sudo gpasswd -a userName dialout # add user to the required group
$ groups # need to logout and login, for the newly added group to take effect

To check out:

http://garagelab.com/profiles/blogs/tutorial-array-of-arrays-in-arduino?xg_source=activity
http://miscsolutions.wordpress.com/2011/10/16/five-things-i-never-use-in-arduino-projects/