Hardware Reference
In-Depth Information
Robotics and Sensors
In addition to purely software-based inputs and outputs, it's also possible to tie Scratch into
external hardware using sensor boards and robotics systems. Thanks to its multithreaded
nature and powerful inter-process messaging system, Scratch can be used to create a surpris-
ingly advanced robotics engine and is by far the easiest way to place a Raspberry Pi at the
heart of a simple robot.
Unlike Python, which is a more powerful but significantly more complex programming lan-
guage, Scratch can't make use of the Raspberry Pi's GPIO port to communicate with external
hardware. As a result, it needs some additional equipment before it can interact with the
physical world.
Sensing with the PicoBoard
Designed by the SparkFun electronics company, the PicoBoard is an add-on module that
connects to a computer running Scratch and provides a variable slider input, a light sensor, a
button, a sound sensor and four pairs of alligator clips that can be used to monitor external
electrical devices.
There are currently two types of PicoBoard: the original model, which uses a serial connec-
tion, and its replacement, which uses a USB connection. The latter is supported by the
Raspberry Pi. Simply connect it to a free USB port or a port on a USB hub connected to the
Pi, restart Scratch, and you'll be able to use its various functions within the Scratch interface.
Details on the PicoBoard can be found at http://www.sparkfun.com/products/
10311 .
Robotics with LEGO
In addition to add-in sensor modules, it's possible to control an external robotics system
through Scratch. The LEGO Education WeDo robotics kit is designed to connect motors,
distance sensors and speed sensors to a computer—all of which can be controlled using spe-
cialised blocks found in Scratch.
For children, the WeDo kit is an excellent way to get started with robotics: the components
clip together just like regular LEGOs, and there are no risks of receiving an electric shock
should anything be badly connected. The WeDo kit boasts compatibility with regular LEGO
and LEGO Technik kits, too, meaning it's possible to build large projects quickly and easily.
More information on using a LEGO Education WeDo kit with Scratch can be found at
http://info.scratch.mit.edu/WeDo .
Search WWH ::




Custom Search