
PicoBlocks - Reference
Sensors
Block
Word
Example Usage
IR
ir
Reports the value of the most recent number beamed to the
Cricket.
to test
waituntil [newir?]
if ir = 10 [chirp]
end
The Cricket chirps if the number beamed to it is equal to 10.
reset
timer
resettimer
Resets to zero the value of the Cricket’s internal timer. See next
example.
timer
timer
Reports the Cricket’s timer value. Timer measures time in
hundreths of a second.
to test
resettimer
chirp
waituntil [touch?]
display timer
end
The display shows the amount of time that has elapsed between
when the Cricket chirps and when the touch sensor is pressed.
Flow
Block
Word
Example Usage
wait
wait
number
Waits a certain amount of time (in tenths of a
second).
chirp wait 10 chirp
The Cricket pauses for a second between the
two chirps.
text only
mwait
number
Waits a certain amount of time (in
milliseconds).
setlightcolor 20 mwait 10 lightoff
The light flashes very briefly.
text only
no-op
Does nothing for about 40 microseconds.
repeat 10 [no-op]
The Cricket waits for 400 microseconds.
waituntil
waituntil [
condition
]
Waits until the condition is true.
waituntil [touch?] chirp
The Cricket waits until you press the touch
sensor before chirping.
forever
forever [
list
]
Repeats a list of instructions forever.
forever [chirp wait 3]
The Cricket chirps continuously.