Introduction to Logo Blocks

LogoBlocks lets you create iconic programs to control a Programmable Brick. To create programs, you just drag blocks form the palette (on the left of the screen) and snap them together on the canvas (on the right side of the screen). The buttons on the bottom left let you switch between palettes, each containing a different set of commands.

(Before starting to program in LogoBlocks, make sure that your cricket and interface cricket are set up correctly. See the document: Getting Started with Your Cricket.)

To create programs in LogoBlocks, you just drag blocks from the palette (on the left of the screen) and snap them together. All programs must be attached to a purple "hat". For example, create this program:

 

This program tells the cricket
to beep
then wait for one second,
then beep again.

To execute the program,
double-click on the purple"hat".

 

 

When you execute a program (by double-clicking on the purple hat), you will notice yellow lights flashing on the cricket and the interface cricket, indicating that the crickets are communicating with one another. The program will then run and be saved to the cricket. To run it again, you can press the white "run" button on the cricket itself.


Now, connect a motor to the "motor-a" port on the cricket, and create the following program:

This program
tells motor-a
to turn on for one second,
then reverse direction,
then turn for two seconds in the other direction.

(Note: To change the number on a block, simply click on the block and type in the new number)

 


Now add a second motor, connecting it to the motor-b port.

This program
tells both motors
to repeat a set of commands eight times.
The motors will turn on for one second,
then reverse direction, then turn on for another second,
then reverse direction, then turn on…

(Note: To get the ab, block, simply click on the a, block several times.)

 


Now connect a touch sensor to the sensor-a port.

This program tells the cricket
to wait until the touch sensor is pressed,
and then turn on motor-b
for two seconds

 


Now connect a light sensor to the sensor-b port.

This program tells the cricket
to wait until the light sensor gets a reading of less than 100,
then to turn on motor-a
for two seconds.
(Note: The light sensor always reports a value between 0 and 255)

 

Updated 2002.06.18