Difference between revisions of "Development Team/Arduino"
Line 62: | Line 62: | ||
*5) Execute "Arduino board - connect" | *5) Execute "Arduino board - connect" | ||
− | [[Image: | + | [[Image:ArduinoConnect.png|500px]] |
Revision as of 13:26, 22 December 2009
There are different options to connect your arduino board to Sugar (trough sugar-capable activities)
Squeak
Thanks to the great work found on Gira
We can download an squeak project and install it on our Sugar. This script can help in the process.
#/bin/bash echo "Downloading.." echo "" curl -o Arduino.zip http://tecnodacta.com.ar/gira/Arduino.7.zip unzip Arduino.zip echo "Executing.." echo "" cd Arduino.7/ ./Arduino.sh.
Note that on an XO laptop you have to tweak some your Arduino.sh script in these or similar ways
#!/bin/sh APP=`dirname $0` EXE="$APP/Contents/Linux686" RES="$APP/Contents/Resources" exec "/usr/bin/squeak" \ -plugins "$EXE" \ -encoding latin1 \ -vm-display-X11 \ "$RES/Arduino.2.image"
Installation and use procedure
Having executed our initiation script we have an squeak project with essential particularities in order to run our Arduino. Inside Electronics flaps we can find different tools.
But first we have to connect our arduino board, this is done in the following way,
- 1) Connect the board to the USB port.
- 2) If the board doesn't have Firmata we have to upload it form Arduino IDE.
- 3) To find out the serial port to which the board belongs we can go to Tools->Serial Port of a list we can always find the following:
/dev/ttyUSB0 /dev/ttyS0
- 4) Get an "Arduino board" from the Electronics flap, open its halo by right-clicking it, then open the Viewer by clicking the button that looks like an eye, and then find "arduino - connection" category
- 5) Select the desired port (i.e. "/dev/ttyUSB0")
- 5) Execute "Arduino board - connect"
- 6) Wait more or less two seconds an then the slot "is connected" have to change to true.
- 7) After searching "arduino - digital pins mode" category and resetting the value of "arduino board - is reading digital pins" (going from false to true). That's how the digital inputs are set.
- 8) Now we are ready to use it!.
Turtle Art
The code needed is located at (Thnks to Sayamindu Dasgupta)
TODO: Link to an XO bundle.
This uses the same firmata protocol that the arduino-squeak connection uses.