PICO PicoCricket User manual

PicoCricket
Reference Guide
The Playful Invention Company
PicoCricket
Reference Guide
Version 1.0

Credits
Design Team
Mitchel Resnick
Brian Silverman
Paula Bontá
Robbie Berg
Natalie Rusk
Industrial Design: Smart Design
Graphic Design: Big Blue Dot
We would like to give special thanks to:
PICO staff members Chad Burt and Mike Durcak for their invaluable ideas and enthusiasm.
Diana Gee Silverman for the on-line help, Danny Lutz for the sounds, and Lawrence
Shubert for guiding PICO through the intricate aspects of compliance testing and
manufacturability.
staff from the Playful Invention and Exploration (PIE) project for developing new Cricket
activities, particularly Keith Braafladt, Stephanie Hunt, Chip Lindsey, Hideki Mori, Kristen
Murray, Mike Petrich, Margaret Pezalla-Granlund, Natalie Rusk, Michael Smith-Welch, Karen
Wilkinson, and Diane Willow.
MIT researchers and students who contributed to Cricket R&D, particularly Andy Begel,
Robbie Berg, Rahul Bhargava, Rick Borovoy, Fred Martin, Bakhtiar Mikhak, Mitchel Resnick,
and Brian Silverman.
the LEGO Company for its continuing support, particularly Kjeld Kirk Kristiansen, Lisbeth
Valther Pallesen, Jens Maibom, and Erik Hansen.
© 2006.The Playful Invention Company Inc. All rights reserved.This material may not be
reproduced, displayed, modified, or distributed without the express prior written permission
of the copyright holder.

Contents
Credits 2
lntroduction 4
PicoBlocks 8
Blocks Summary 12
Blocks - Detailed by Category 14
Melody and Rhythm Editors 30
The PicoBlocks Text Language 35
Error Messages 48

PicoBlocks - Reference
4
lntroduction
Welcome! This Reference Guide provides an overview of the PicoCricket family of parts and
the PicoBlocks software used to program the PicoCricket.
If you are just getting started with the PicoCricket and PicoBlocks, please go through the
Setup Guide and Getting Started booklet first, to get an overall introduction. If you want more
detailed information, then come back to this Reference Guide.
We are continually updating the Reference Guide.You can download the latest version from
www.picocricket.com/support
PicoCricket Family
The PicoCricket family includes the following parts:
PicoCricket
The PicoCricket is a tiny computer that can control things in the world.The Cricket has four
ports where you can plug in other devices, such as sensors, motors, and lights.You can plug
any of these devices into any of the Crickets ports.

PicoBlocks - Reference 5
The Cricket has three types of indicator lights:
The on-off indicator light turns on (orange) when you turn on the Cricket. If the
batteries are low, the light flashes rapidly when you turn on the Cricket.
The program-running indicator light turns on (green) when the Cricket is running a
program, and it changes color to amber when the Cricket is running two programs at
the same time.
The IR-communication indicator lights flash (yellow) when the Cricket is
communicating through its infrared transmitter.
If you push the Cricket button while the Cricket is running a program, the program will stop. If
you push the button when no program is running, the Cricket will re-run the last program that
it ran.
Even when you turn the Cricket off, it remembers the last program that it ran. So if you run a
program, turn off the Cricket, turn it back on later, and push the button, the Cricket will run the
program again.
Beamer
The Beamer transmits information (via infrared signals) from your computer to your Cricket.
When you write a program using PicoBlocks software on your computer, you send the
program to the Cricket via the Beamer.

PicoBlocks - Reference
6
The PicoCricket Kit includes a USB-serial cable for connecting the Beamer to a USB port on
your computer. Alternatively, you can connect the Beamer to a serial port, using a standard
serial cable (not included).
When you are sending information to the Cricket, make sure that the antennas on the
Beamer are facing towards the antennas on the Cricket.While the Beamer and Cricket are
communicating, the indicator lights in the antennas will flash yellow (on both the Beamer and
the Cricket).
The Beamer has a range of about a 1 meter. Note that a Beamer can communicate with one
Cricket at a time. If you have multiple Crickets, make sure that only one of them is in range of
the Beamer at any time.
Actuators
Actuators are devices that make things happen in the world.The PicoCricket Kit includes four
types of actuators: colored lights, sound box, motor (with motor board), and numeric display.
Name Description Programming Blocks Icon
Light You can set the color of the light across
the entire rainbow, from red to violet.You
can also set the brightness of the light.
Sound
Box
The sound box is a small synthesizer that
can play notes, melodies, sound effects,
and rhythms. PicoBlocks software includes
special editors for creating melodies and
rhythms.You can set and change which
instrument will play notes and melodies.
note
Motor
and
Motor
Board
The motor board connects to the Cricket,
and the LEGO motor connects to the
motor board.You can turn the motor on
and off, and set its power and direction.
Display
The three-digit display can show any
number between 0 and 999. It is especially
useful for displaying sensor values.

PicoBlocks - Reference 7
Sensors
Sensors allow your Cricket to respond to sounds, lights, or other changes in its environment.
Name Description Programming
Blocks
Icon
Light
Sensor
Reports the brightness of light. For example, you can
use the light sensor to detect when someone casts
a shadow with their hand – or when the sun shines
through the window.
brightness
Sound
Sensor
Reports the loudness (or volume) of sound. For
example, you can use the sound sensor to detect
when someone claps their hands – or when someone
sings into the sensor.
loud?
loudness
Touch
Sensor
Reports if the button is pressed. For example, you
can write a program that makes something happen
(a motor spinning or a light changing color) when
someone presses the touch sensor.
touch?
Resistance
Sensor
Reports the resistance in the circuit formed by the
alligator-clip cables. If you put different materials
(for example, play-dough or a banana) between the
alligator clips, the resistance will change.You can also
use the resistance sensor to detect when the alligator
clips are touching each other (or connected through a
conductive material, such as aluminum foil).
connected?
resistance
Each of the programming blocks will be described further in the following pages. For
examples of how to use the actuators and sensors, see “Magic Lantern”and other sample
project placemats.
Cricket Care
1. Remember to turn off the Cricket when you aren’t using it.
2. If the orange on-off indicator light flashes, it means that your Cricket is running out of
batteries.To change the batteries, follow the instructions in the Setup Guide.
3. Be gentle with the cable connectors. If you push the connectors up and down with too
much force, the connectors will break.
4. Keep your Cricket devices away from water and other liquids.
5. If your Cricket is misbehaving, check the Troubleshooting section in our website:
www.picocricket.com/troubleshooting

PicoBlocks - Reference
8
PicoBlocks
Overview
PicoBlocks is a programming language designed specifically for programming your Cricket.
With PicoBlocks, you create programs by snapping graphical blocks together into stacks.
Tools
?
?
STOP
Undo
2
The tools are used for taking different actions on the blocks, such as copying blocks, deleting
blocks, or sending blocks to the Cricket.When you click on a tool, the cursor turns into that
tool.
Arrow
Use the Arrow to drag blocks from the Blocks Palette to the Workspace, or within the
Workspace.To move an entire stack, drag from the top block. Dragging a block from the
middle of a stack will also move any blocks attached beneath the one you are dragging.
You can get rid of blocks by dragging them off of the Workspace, in any direction. If you delete
blocks by mistake, click Undo
This is your Workspace
Drag and drop blocks to
create your stacks
These are the tools
Click on the tabs
to get different
categories of
blocks
This is a stack
Blocks Palette

PicoBlocks - Reference 9
Magic Wand
Use the Magic Wand to run a program.When you click on a block or stack with the Magic
Wand, it sends the program to the Cricket and tells the Cricket to run the program.
chirp
forever
setlight
color
brightness
You can use the Magic Wand to click on blocks in the Blocks Palette, the same way you click on
blocks in the Workspace.This feature is useful for testing out a block.
Another way to run a program is by double-clicking with the Arrow, instead of single-clicking
with the Magic Wand.
Scissors
Use the Scissors to get rid of blocks. Clicking on a block in a stack will also cut all blocks
attached below it.
If you delete blocks by mistake, click Undo
You can also get rid of blocks by dragging them out of the Workspace.
waituntil
motor
on
reverse
motor
onfor
touch?
10
waituntil
motor
on
touch?
Stamper
Use the Stamper to copy blocks and stacks. Click once to copy, then move to a new location
and click a second time to paste.When you click on a block in a stack with the Stamper, it also
copies all blocks attached below it.
You can switch to the Stamper temporarily using Ctrl + , or +
waituntil
motor
on
reverse
motor
onfor
touch?
10
reverse
motor
onfor
10

PicoBlocks - Reference
10
?
?Help
Use the Help tool to get more information. If you click on a block with the Help tool, a window
with more information will appear.
2
Second Wand
Use the Second Wand to tell the Cricket to run a second stack at the same time as it is running
something else.To run two stacks, click on one with the Magic Wand, then the other with the
Second Wand.
For example, you can use the Second Wand to start background music or display sensor
values while another program is running.
melody1
2
display
forever
brightness
2
Tags
Use the Tags tool when you want to tell two devices of the same type to do different things.
For example, if you plug two colored lights into a Cricket, and then send a setlight-color
command to the Cricket, the Cricket will change the color of both lights. If you want to turn
each light to a different color, you need to use Tags.
setlight
color
wait
10
setlight
color
wait
10
?
?

PicoBlocks - Reference 11
Each of the four ports on the Cricket is labelled with a different number of dots. If you want to
send a command to a particular port, then you need to“tag”the block with the appropriate
number of dots. For example, if you plug colored lights into ports and , then you can set
the color of each light individually with the following blocks:
setlight
color
setlight
color
To tag a block, click on the appropriate dot in the Tags tool, then click on the block that you
want to tag.
setlight
color
To remove a tag from a block, click in the center of the Tags tool and then click on the block.
setlight
color
STOP
Stop
Click on the Stop sign to stop all programs running on the Cricket. Make sure that the Cricket
is“in sight” of the Beamer. Alternatively, you can stop programs on the Cricket by pressing the
white button on the Cricket. Note that stopping programs on the Cricket does not turn off
lights attached to the Cricket. If you want to turn off the lights, slide the on-off switch into the
off position.

PicoBlocks - Reference
12
Blocks Summary
This list shows all of the basic blocks in PicoBlocks.
setlight
color
sets the light’s color
setlight
power
sets the light’s power
light
off
turns the light off
display
displays a value on the display
chirp
makes the Cricket chirp
note
plays a note (pitch and duration)
play
sound
Kitten
plays a sound
set
inst
Piano
sets an instrument for
the next note or melody
set
tempo
set
volume
sets the tempo or volume
for the next note, melody
or rhythm
motor
on
motor
off
turns motor on or off
motor
onfor
turns the motor on for a certain
period of time
reverse
reverses the motor’s direction
this
way
that
way
sets the motor’s direction
set
power
sets the motor’s power
touch?
reports true if the touch sensor is
pressed
brightness
reports a value from the light
sensor
loud?
reports true if the sound sensor
detects a loud sound
loudness
reports a value from the sound
sensor
connected?
reports true if the resistance sensor
detects a resistance of 0
resistance
reports a value from the
resistance sensor
beamIR
beams a value to another Cricket
IR
reports a value beamed by
infrared from another Cricket
newIR?
reports true if another Cricket has
beamed a new value by infrared
timer
reports the Cricket’s timer value
in 100ths of a second
reset
timer
sets the Cricket’s timer to 0
wait
waits a number of ticks (where 10
ticks = 1 second)
waituntil
waits until the condition is true
forever repeats a block or stack
forever
repeat repeats a block or stack
a certain number of times
if
then
runs a block or stack if the
condition is true
if
then else
if condition
is true, run one
stack; if not, run
the other stack
stopall
stops everything
stack
stop
stops this stack

PicoBlocks - Reference 13
Blocks Summary - Continued
creates space between blocks,
so that they don’t overlap one another
number
specifies a number (click to highlight, and then type in a number)
+
-
x
/
computes arithmetic operations
r a n d o m
picks a random value between the two numbers
>
<
makes a comparison between two numbers
=
and reports true or false
and
reports true if both conditions are true
or
reports true if either condition is true
not
reports the opposite of a condition
sits on top of stack, and allows you to type in name for the stack
store in
box1
box1
set and report values for variables
store in
box2
box2

PicoBlocks - Reference
14
Blocks - Detailed by Category
Light Blocks
setlight
color
which color
wait
setlight
color
5
4
setlight
color
turns the light blue
waits for 4 ticks
turns the light pink (color 5)
Sets the LED’s color and turns it on.You can set the color by using the color slider, or choosing
a number between 0 and 100. Colors are numbered as follows:
Default value: setlightcolor 0
setlight
power
how bright
setlight
power
wait
40
setlight
power
100
sets light to half power and turns it on
waits for 40 ticks
sets light back to full power
setlightpower can take numbers between 0 (no light) and 100 (full power).You can set the
power by using the slider or a number block.
Default value: setlightpower 100
light
off
wait
setlight
color
15
light
off
turns the light green
waits for 15 ticks
turns the light off
lightoff turns the light off.
pink red yellow aqua light blue violet
0 20 40 60 80 100
10 30 50 70 90
magenta orange green cyan blue

PicoBlocks - Reference 15
display
display what
r a n d o m
display
15 95
displays a random number
Displays a value on the display
Sound Blocks
The Sound palette starts with six basic blocks (shown below).You can create additional blocks
with the Melody and Rhythm editors. See page 30 for information on creating melodies and
rhythms.
chirp
makes the Cricket chirp once
Making the Cricket chirp is a good way to test whether your computer is communicating
properly with the Cricket.
note
how high a note
note
5
50
plays the note 50
for 5 ticks (half a second)
how long
note can play notes between 0 (lowest) and 100 (highest).
You can play notes with the Cricket speaker or with the Sound Box (but it will sound much
better with the Sound Box). For composing melodies, we suggest using the Melody Editor
rather than putting individual note blocks together.
Default value: note 50 2
play
sound
plays this sound (kitten)
play
sound Kitten
23
play
sound
plays sound 23 (horse)
Select a sound with the slider or enter a number between 0 and 100. There are 24 sounds
available (see table below).

PicoBlocks - Reference
16
#Sound # Sound #Sound
1 Piano 9 Claps 17 Cricket
2 Flute 10 Cowbell 18 Fairydust
3 Pizzicato 11 Maracas 19 HighQ
4 Strings 12 Slap 20 Dog
5 Trombone 13 Timbale 21 Rooster
6 Vibes 14 Wood Block 22 Goose
7 Agogo 15 Guiro 23 Horse
8 Cabasa 16 Bloops 24 Kitten
All these sounds require the Sound Box. Sound 0 is the Cricket chirp. For numbers greater
than 24, playsound plays the next sound in the list: 25 plays sound 1, 26 plays sound 2, ... and
so on.
Default value: playsound 24 (kittten)
set
inst
setinstrument which instrument
note
5
16
set
inst Trombone
sets instrument to trombone
plays note 16 (on the trombone)
for 5 ticks (half a second)
Sets the instrument to be used for subsequent notes or melodies.You can select the
instrument with the slider or attach a number between 0 and 100. setinstrument 0 sets the
note or melody with the Cricket’s beeper.
The inputs for setinstrument are the same as for playsound (shown in table above).You can
use any sound as an instrument, but they don’t all work well.
Default value: setinstrument 1 (piano)
set
tempo
melody1
set
tempo
100
sets tempo to 100 (fastest)
plays melody1 at the fastest tempo
settempo takes values between 0 (slowest) and 100 (fastest). The fastest tempo (100) equals
to 240 bpm (beats per minute), while the slowest (0) equals to 60 bpm.
Default value: settempo 50 (120bpm)

PicoBlocks - Reference 17
set
volume
set
volume
30
note
5
50
sets the volume to 30 (quiet)
plays note 50
for 5 ticks (half a second)
setvolume takes values between 0 (no sound) and 100 (loudest). Setvolume only works
with the Sound Box. Default value: setvolume 80
Action Blocks
motor
on
motor
off
motor
on
motor
off
wait
20
turns the motor on
waits for 20 ticks (2 seconds)
turns the motor off
motoroff makes the motor coast to a stop. If you want the motor to stop more abruptly or
more gently, try using the brake and coast commands in the PicoBlocks Text Language.
motor
onfor
how long
motor
onfor
20
turns on motor for 20 ticks (2 seconds)
10 ticks = 1 second
Turns the motor on for the specified number of ticks, then turns it off. motoronfor does the
same thing as a stack with motoron, then wait, then motoroff.
Default value: motoronfor 10
reverse
reverse
motor
onfor
20
motor
onfor
40
motor goes one way for 20 ticks
changes direction
goes the other way for 40 ticks
reverse causes the motor to change the direction in which it is spinning. reverse does not
turn the motor on, it only changes the direction.

PicoBlocks - Reference
18
this
way
that
way
this
way
that
way
motor
onfor
10
motor
onfor
10
sets motor to one direction
turns on for 10 ticks
sets motor to the opposite direction
turns on again for 10 ticks
thisway sets the motor in one direction, thatway sets it in the other direction.Which direction
is which depends on how the motor is plugged in. thisway and thatway do not turn on the
motor, they only set the direction.
set
power
set
power
10
motor
on
sets motor power to 10
turns the motor on
setpower takes values between 0 (no power) and 100 (strongest power). setpower does not
turn on the motor, it only sets the power.
Default value: setpower 100
Sensors Blocks
touch?
is the touch sensor
if
then
forever
chirp
touch?
being pressed?
chirps if the touch sensor
is pressed
touch? reports true when the touch sensor is being pressed. The example above will make
the Cricket chirp continuously while you are pressing the button on the touch sensor. If you
want to chirp only once each time you push the button, you should make a stack similar to
the one shown below:

PicoBlocks - Reference 19
forever
waituntil touch?
touch?
chirp
waituntil
not
waits until the touch
sensor is released
brightness
brightness
display
displays the number reported by the
light sensor
brightness reports numbers between 0 (no light) and 100 (lots of light)
loud?
setlight
color
loud?
waituntil
waits until the sound sensor
detects a sound
turns the light pink
loud? reports true if the sound sensor detects a sound with loudness greater than 15.
loudness
waituntil
>
loudness
30
setlight
color
waits until the sound
sensor detects a clap
turns the light green
loudness reports numbers between 0 (no sound) and 100 (loud sound).
connected?
forever
waituntil
chirp
connected?
waits for resistance sensor
to detect a connection
when a connection is sensed, it chirps
connected? reports true if the resistance sensor detects a resistance of less than 50.

PicoBlocks - Reference
20
resistance
resistance
forever
display
displays the number reported
by the resistance sensor
resistance reports numbers between 0 (no resistance) and 100 (lots of resistance).If you are
getting numbers in a very narrow range, you should adjust the sliders as follows:
resistance
try this if you aren’t getting low numbers
resistance
try this if you aren’t getting high numbers
Remember to use the magic wand after moving the sliders
beamIR
beamIR
forever
wait
10
r a n d o m
0100
beams a number between
0 and 100
beamIR beams a number to another Cricket via infrared (IR).To use this command, you need
two Crickets: one beaming the IR signal, the other receiving the IR signal. See example for
IR block below. We recommend using numbers in the range 0 to 100. Numbers outside this
range may produce unexpected results.
newIR?
IR
newIR?
IR
forever
waituntil
note
10
waits for a new IR message from
another Cricket
plays a note based on the
number received
IR stands for Infra Red.
newIR? reports true if a new infrared (IR) signal has been received. IR reports the value of the
latest infrared signal received.
Table of contents
Popular Desktop manuals by other brands

Classic Exhibits
Classic Exhibits visionary DESIGNS MOD-1272 Workstation Setup instructions

Compaq
Compaq ProSignia 200 manual

Toshiba
Toshiba Equium 5160D Preliminary maintenance manual

Lenovo
Lenovo Ispirati 2001 user guide

IAC INDUSTRIES
IAC INDUSTRIES D4 Assembly instructions

Sony
Sony VAIO Digital Studio PCV-RX590G reference guide