The Freetronics Leostick
is a low cost Arduino board. (It is presumed to be low cost, it was cheap enough to place into the satchels of the attendees of LCA2012
.) The XO-1.5 already has 2 channel analogue input, an Arduino board can add a lot of extra input and output channels.
This could facilitate a number of low cost science and robotics experiments in schools, experiments at a cost suitable for developed and even developing countries.
There are a number of ways such a board could be used:
- from the Arduino IDE
- from TurtleArt, Firmata running on the Arduino
The second version is probably the most practical for classroom use. Once the Leosticks are loaded with Firmata (and this could even be at the factory) all that is requited is TurtleArt drag and drop programming.Installing the Arduino IDE onto a XO-1.5 laptop (OS880)
In terminal enter the followingsudo yum install arduino
This installs an older version (0021), more importantly it installs all the dependencies including Java and avr-gcc. It is a 60MB download which expands to 200MB of storage, be warned it uses up a lot of precious space.
The IDE can be started from the Gnome menu or with the command arduino
but it does not have the permissions to see the Arduino board on the USB serial port so start it as root (maybe why
) sudo arduino
The IDE can then be upgraded to version 1.0. This is the version recommended for the Leostick. Download version1.0 from http://www.arduino.cc/en/Main/Software
The file arduino-1.0-linux.tgz uncompresses with the Gnome archive manager. Uncompress it to a convenient location, if for example if you uncompress it to Documents, you will find a directory arduino-1.0 in this directory.
You now have 2 versions of the program, 1.0 (at /home/olpc/Documents/arduino-1.0 ) and 0021 (with components at /usr/share/doc/arduino-0021 and /usr/bin). The later versions 1.0 uses the dependencies installed with the earlier one 0021.
As described at http://www.freetronics.com/pages/leostick-quickstart-guide
uncomment the following lines in /home/olpc/Documents/arduino-1.0/hardware/arduino/boards.txt
(or in version 0021 you would need to add them)leonardo.name=Arduino Leonardo
Launch the Arduino IDE (sudo /home/olpc/Documents/arduino-1.0/arduino), and select Tools > Board > Arduino Leonardo
to select the Leonardo hardware
select Tools > Serial Port
a new device appears with Leostick plugged in, dev/ttyACM0, select it.
You can now upload example programs, eg blink, to the Leostick.
NOTE: this will overwrite the program that came with your Leostick that plays a tune, watchhttp://forum.freetronics.com/viewtopic.php?f=27&t=167
for the original programControlling the Arduino with Turtle Art
Load Firmata software into the Leostick, this can be done on an OLPC, another Linux PC or Windows. Once this is done the Leostick can be used as a I/O expander for Turtle Block drag and drop programming. No Terminal or Gnome work would be needed.http://tonyforster.blogspot.com/2010/10/arduino-fork-of-turtle-art.html
The version here
works for older Arduino boards on Sugar 0.88 It needs patching at TurtleArtActivity.py, line 834 as described in the link above. The baud rates of Turtle Art and Firmata need to be patched.
Sugar 0.88 (Fedora 11) recognises an older Arduino board as as serial device but not the Leostick. Later Arduino boards are dev/ttyACM0This version
is hard coded to dev/ttyACM0, that means it only works the first time the Leostick is plugged in and not at all for older Arduino boards. It is patched and works on Sugar 0.94.
The quick and dirty patches are:Turtleartactivity line 835
line 868 commented out
serialposix.py line 273
# self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
self.fd = os.open('/dev/ttyACM0', os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
Labels: Arduino, olpc, programming, Sugar