Difference between revisions of "Development Team/Arduino"

From Sugar Labs
Jump to navigation Jump to search
 
(20 intermediate revisions by 6 users not shown)
Line 3: Line 3:
  
 
==Squeak==
 
==Squeak==
Thanks to the great work found on [http://tecnodacta.com.ar Tecnodacta]
+
Thanks to the great work found on [http://tecnodacta.com.ar/gira/ Gira]
  
 
We can download an squeak project and install it on our Sugar.
 
We can download an squeak project and install it on our Sugar.
Line 15: Line 15:
 
  echo ""
 
  echo ""
 
  cd Arduino.7/
 
  cd Arduino.7/
  ./Arduino.sh.
+
  ./Arduino.sh
  
  
Line 22: Line 22:
 
  #!/bin/sh
 
  #!/bin/sh
 
  APP=`dirname $0`
 
  APP=`dirname $0`
#
 
 
  EXE="$APP/Contents/Linux686"
 
  EXE="$APP/Contents/Linux686"
 
  RES="$APP/Contents/Resources"
 
  RES="$APP/Contents/Resources"
 
  exec "/usr/bin/squeak" \
 
  exec "/usr/bin/squeak" \
-plugins "$EXE" \
+
-plugins "$EXE" \
-encoding latin1 \
+
-encoding latin1 \
-vm-display-X11  \
+
-vm-display-X11  \
"$RES/Arduino.2.image"
+
"$RES/Arduino.2.image"
  
 
    
 
    
  
== Installation and use procedure ==
+
=== 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.
 
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.
Line 42: Line 41:
 
*1) Connect the board to the USB port.
 
*1) Connect the board to the USB port.
  
*2) If the board doesn't have Firmata we have to upload it form Arduino IDE.
+
*2) If the board doesn't have Firmata we have to upload it form [http://arduino.cc/en/Main/Software Arduino IDE].
  
 
[[Image:Firmata1.png]]
 
[[Image:Firmata1.png]]
Line 53: Line 52:
  
  
*4) Create an arduino board: open up the viewer and find "arduino - connection" category
+
*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
 
   
 
   
 
[[Image:Arduinoconection.png]]
 
[[Image:Arduinoconection.png]]
  
 +
*5) Select the desired port (i.e. "/dev/ttyUSB0")
  
*5) Execute "Arduino board - connect on port - 5"
+
[[Image:Select-port.3.png|500px]]
 +
 
 +
*6) Execute "Arduino board - connect"
 
   
 
   
[[Image:Connectonport.png]]
+
[[Image:ArduinoConnect.png|500px]]
  
  
*6) Wait more or less two seconds  an then the  slot "is connected" have to change to  true.
+
*7) 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) 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.  
  
 
[[Image:True-falsedigitalpins.png]]
 
[[Image:True-falsedigitalpins.png]]
  
  
*8) Now we are ready to use it!.
+
*9) Now we are ready to use it!.
  
 
[[Image:Hypercubo1.png]]
 
[[Image:Hypercubo1.png]]
Line 80: Line 82:
  
  
==Turtle Art==
+
==Turtle Blocks (Turtle Art) with Arduino Plugin==
 +
 
 +
[[File:turtleart-arduino-palette.png|800px]]
 +
 
 +
There are several efforts to develop Turtle Art support for Arduino.
 +
This implementation uses the same [http://www.firmata.org firmata] protocol that the arduino-squeak connection uses.
 +
 
 +
* [http://tonyforster.blogspot.com/2010/10/arduino-fork-of-turtle-art.html Setting up Turtle Arduino]
 +
* [http://tonyforster.blogspot.com/2010/10/turtle-arduino-display-inputs.html Read digital inputs] [[File:Ard.ta]]
 +
* [http://tonyforster.blogspot.com/2010/10/turtle-arduino-digital-write.html Arduino write output] [[File:Turtle Art Activity ardout.ta]] [[File:Tamyblock mouse.odt]]
 +
* [http://tonyforster.blogspot.com/2012/01/arduino-and-xo-laptop.html The Freetronics Leostick]
 +
 
 +
 
 +
The Arduino functionality was corrected from previous versions:
 +
* Analog and digital reading now works correctly
 +
* Auto detection of ttyUSBx port for FTDI device (Arduino board uses this for USB)
 +
 
 +
It requires the Firmata protocol to be uploaded to the Arduino board.
 +
Use the latest Firmata version (2.1 as of now) downloaded from the Firmata page (firmata.org)
 +
The Firmata version included with the Arduino IDE has some inconsistencies.
 +
 
 +
This version has english and spanish translations.
 +
 
 +
===Screenshots===
 +
 
 +
[[File:turtleart-arduino-example1.png]]
 +
 
 +
=== Source Code ===
  
The code needed is located at (Thnks to Sayamindu Dasgupta)
+
You can see all code in: [http://git.sugarlabs.org/arduino arduino_plugin GIT]
  
*http://git.sugarlabs.org/projects/turtleart/repos/arduino-support
+
===Downloads===
  
TODO: Link to an XO bundle.
+
The plugin file can be downloaded from [[File:arduino.tar.gz]].
  
This uses the same [http://www.firmata.org firmata] protocol that the arduino-squeak connection uses.
+
== Spanish Version ==
  
===Some use examples and Screenshots===
+
Please go to
  
*http://people.sugarlabs.org/sayamindu/ta_arduino.png
+
* http://co.sugarlabs.org/go/Arduino
*http://people.sugarlabs.org/rafael/Arduino-turtle1.png
 
*http://people.sugarlabs.org/rafael/Draw-leds.png
 

Latest revision as of 02:53, 17 March 2012

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.

Firmata1.png

  • 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

Arduinoconection.png

  • 5) Select the desired port (i.e. "/dev/ttyUSB0")

Select-port.3.png

  • 6) Execute "Arduino board - connect"

ArduinoConnect.png


  • 7) Wait more or less two seconds an then the slot "is connected" have to change to true.


  • 8) 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.

True-falsedigitalpins.png


  • 9) Now we are ready to use it!.

Hypercubo1.png




Turtle Blocks (Turtle Art) with Arduino Plugin

Turtleart-arduino-palette.png

There are several efforts to develop Turtle Art support for Arduino. This implementation uses the same firmata protocol that the arduino-squeak connection uses.


The Arduino functionality was corrected from previous versions:

  • Analog and digital reading now works correctly
  • Auto detection of ttyUSBx port for FTDI device (Arduino board uses this for USB)

It requires the Firmata protocol to be uploaded to the Arduino board. Use the latest Firmata version (2.1 as of now) downloaded from the Firmata page (firmata.org) The Firmata version included with the Arduino IDE has some inconsistencies.

This version has english and spanish translations.

Screenshots

Turtleart-arduino-example1.png

Source Code

You can see all code in: arduino_plugin GIT

Downloads

The plugin file can be downloaded from File:Arduino.tar.gz.

Spanish Version

Please go to