ProtoSnap Contributors Guide: Difference between revisions
No edit summary |
|||
(21 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} |
{{TOCright}} |
||
This ProtoSnap Contributors Guide connects your XO to the real world of electronics, sensors and activators -- using SparkFun's |
This ProtoSnap Contributors Guide connects your XO to the real world of electronics, sensors and activators -- using SparkFun's now retired [https://www.sparkfun.com/products/10889 ProtoSnap - Pro Mini]. We used the Logo-like [http://wiki.sugarlabs.org/go/Activities/Turtle_Blocks Turtle Blocks]<ref>Turtle Blocks was previously known as Turtle Art.</ref> visual programming environment. Please ask questions on the unleashkids@googlegroups.com mailing list! You can join right here: http://groups.google.com/group/unleashkids |
||
These instructions have been tested on the XO- |
These instructions have been tested on the XO-1 and XO-4 Touch laptop using the latest [[Release_notes/13.2.0|13.2.0]]. |
||
==Ingredients== |
|||
Loosely speaking, this 5-phase install will proceed as follows: |
|||
* a ProtoSnap or Arduino Pro Mini, with the StandardFirmata already uploaded, if not see [[/Upload|How to upload StandardFirmata to a ProtoSnap using ino]], or [[Arduino|How to upload StandardFirmata using the Arduino IDE]], |
|||
# install requirements |
|||
* an XO laptop, with OLPC OS [[Release_notes/13.2.6|13.2.6]], |
|||
# setup build environment |
|||
* a USB cable between the two. |
|||
# build it |
|||
# upload it (to the SparkFun board) |
|||
# install the TurtleBlocks plugin |
|||
==Recipe== |
==Recipe== |
||
* install the [http://activities.sugarlabs.org/en-US/sugar/addon/4434 TurtleBots-22] activity<ref>TurtleBots is a repackaging of TurtleBlocks by the Butia project with the Arduino plugin already present.</ref>, and start it, |
|||
* Install [[Release_notes/13.2.0|13.2.0]] onto your XO laptop |
|||
* plug the ProtoSnap or Arduino Pro Mini into the XO laptop using the USB cable, and wait a few seconds for the indicators to stop flashing, |
|||
* Connect your XO to Wifi Internet ([http://laptop.org/start/neighborhoodview.shtml Neighborhood View] = F1 key) |
|||
* click on the palette of Arduino blocks, |
|||
* Open the Terminal Activity (within Sugar's "List View" in the top-right of the [http://laptop.org/start/homeview.shtml Home View] = F3 key) |
|||
* notice how only the ''refresh Arduino'' block is available, |
|||
** On an XO-1 the 256 MB of memory is not enough to do the following installs. So you will need to return the GUI (Graphical User Interface) memory to the system before you start the install (issue the command "sudo init 3", and hit return to log in as superuser), or temporarily add [[Swap]], |
|||
* drag a ''refresh Arduino'' block into the main area, then click on it, |
|||
* Install 3 packages, each of which take a couple minutes to install. Run: |
|||
* notice how the rest of the palette is made available; if this doesn't happen you have a problem and cannot proceed, |
|||
sudo yum install -y ino git make |
|||
* drag a ''pin mode'' block into the main area, drag the ''OUTPUT'' block to the mode socket on the ''pin mode'' block, |
|||
* Create a default .inorc file to identify the Arduino Pro Mini 5V/16MHz which is included in the ProtoSnap: |
|||
* drag a ''digital write'' block and attach it to the bottom of the ''pin mode'' block, |
|||
echo board-model = pro5v328 >> ~/.inorc |
|||
* click on the ''pin mode'' block, and it will run both blocks, and the D13 LED on the ProtoSnap or Arduino Pro Mini should turn on. |
|||
* Run the following 4 commands to create a project directory: |
|||
mkdir firmata |
|||
Alternatively, try our [[Media:TurtleBlocks_Activity.ta|sample TurtleBlocks project]] which uses the other LED on a ProtoSnap: |
|||
cd firmata |
|||
ino init |
|||
⚫ | |||
mkdir lib |
|||
* Correct a packaging error in "ino", running these 2 commands: |
|||
sudo mkdir /usr/share/arduino/hardware/tools |
|||
sudo cp /etc/avrdude/avrdude.conf /usr/share/arduino/hardware/tools |
|||
* copy the StandardFirmata source into the project directory and build it: |
|||
cp /usr/share/arduino/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino ./src/sketch.ino |
|||
ino build |
|||
* Plug in a "USB-A to mini-USB" cable, connecting your XO to the ProtoSnap (Ian can provide these, or 80 cents @ monoprice.com). Then run: |
|||
ino upload |
|||
* ProtoSnap's bright white light will turn on! Finally, run: |
|||
git clone <nowiki>https://github.com/itdaniher/turtleblocks-arduino.git</nowiki> ~/Activities/TurtleBlocks.activity/plugins/arduino |
|||
* Or run this script, (to avoid needing to install git as noted above): |
|||
wget <nowiki>https://github.com/itdaniher/turtleblocks-arduino/archive/master.zip</nowiki> |
|||
unzip master.zip |
|||
mv turtleblocks-arduino-master/ ~/Activities/TurtleBlocks.activity/plugins/arduino/ |
|||
* Return to Sugar's Activity wheel (Home View) and launch the TurtleBlocks Activity. Load the sample TurtleBlocks project here: |
|||
http://wiki.laptop.org/go/File:TurtleBlocks_Activity.ta |
|||
⚫ | |||
== Screenshots == |
== Screenshots == |
||
Line 47: | Line 28: | ||
[[image:Screenshot_of_TurtleBlocks_Activity_3.png|600px]] |
[[image:Screenshot_of_TurtleBlocks_Activity_3.png|600px]] |
||
[[image:Itdaniher--photo.JPG|400px]] |
[[image:Itdaniher--photo.JPG|400px]] |
||
⚫ | |||
"Sometimes the [https://www.sparkfun.com/products/10889 proMini] gets stuck and needs a manual reset to reprogram. Try programming it again, and hit the RESET button just before the code is downloaded to the board. This often fixes the board. Afterwards, you shouldn't need to do this again. Hopefully." ''Thanks to the amazing Brian Huang at SparkFun!'' |
|||
== See Also == |
== See Also == |
||
* [[Arduino]] |
* [[Arduino]] |
||
* [http://inotool.org/ Ino], a command line toolkit for working with Arduino hardware, |
|||
⚫ | |||
* [http://inotool.org/quickstart Ino quick start guide] |
|||
<references/> |
Latest revision as of 01:56, 17 November 2015
This ProtoSnap Contributors Guide connects your XO to the real world of electronics, sensors and activators -- using SparkFun's now retired ProtoSnap - Pro Mini. We used the Logo-like Turtle Blocks<ref>Turtle Blocks was previously known as Turtle Art.</ref> visual programming environment. Please ask questions on the unleashkids@googlegroups.com mailing list! You can join right here: http://groups.google.com/group/unleashkids
These instructions have been tested on the XO-1 and XO-4 Touch laptop using the latest 13.2.0.
Ingredients
- a ProtoSnap or Arduino Pro Mini, with the StandardFirmata already uploaded, if not see How to upload StandardFirmata to a ProtoSnap using ino, or How to upload StandardFirmata using the Arduino IDE,
- an XO laptop, with OLPC OS 13.2.6,
- a USB cable between the two.
Recipe
- install the TurtleBots-22 activity<ref>TurtleBots is a repackaging of TurtleBlocks by the Butia project with the Arduino plugin already present.</ref>, and start it,
- plug the ProtoSnap or Arduino Pro Mini into the XO laptop using the USB cable, and wait a few seconds for the indicators to stop flashing,
- click on the palette of Arduino blocks,
- notice how only the refresh Arduino block is available,
- drag a refresh Arduino block into the main area, then click on it,
- notice how the rest of the palette is made available; if this doesn't happen you have a problem and cannot proceed,
- drag a pin mode block into the main area, drag the OUTPUT block to the mode socket on the pin mode block,
- drag a digital write block and attach it to the bottom of the pin mode block,
- click on the pin mode block, and it will run both blocks, and the D13 LED on the ProtoSnap or Arduino Pro Mini should turn on.
Alternatively, try our sample TurtleBlocks project which uses the other LED on a ProtoSnap:
Please submit all ProtoSnap bug reports to our mailing list: unleashkids@googlegroups.com (join @ http://groups.google.com/group/unleashkids), and all TurtleBlocks or TurtleBots bug reports to sugar-devel@lists.sugarlabs.org
Screenshots
See Also
Notes
<references/>