This link has been bookmarked by 2 people . It was first bookmarked on 16 Jun 2007, by York Jong.
-
16 Jun 07
-
- procedure definition with inputs and return values;
- global variables and local procedure inputs;
- control structures like if, repeat, and loop;
- a 16-bit number system (addition, subtraction, multiplication, division, remainder, comparison, bitwise operations, random function);
- motor and sensor primitives;
- timing functions and tone-playing functions;
- data recording and playback primitives;
- communications primitives.
-

-
The text area in the lower left is the “Command Center.” Statements typed into this window are immediately transmitted to the Cricket and then executed.
-
Motor commands are used by first selecting the motor (using a, b, or ab,) and then telling it what to do
-
ab, onfor 20
There is also a free-running timer, which keeps track of elapsed time even when the Cricket is doing other things.
-
global [cats dogs]
creates two globals, named cats and dogs. Additionally, two global-setting primitives, setcats and setdogs, are instantiated.
-
There is a single global array for storing data which holds 2500 numbers.
-
To transfer data to the PC, use the standard Cricket Logo software. In the “Cricket” menu, there is an option “Upload Data.” This will bring up a dialog box that allows you to retrieve the data from the Cricket and then save it into a text file.
-
Please note that the memory for keeping track of recursive calls during execution is quite small, and limited to perhaps six calls deep. If the stack overflows, the Cricket halts and beeps five times.
-
The Cricket supports tail recursion, converting the recursive call into a goto statement, and avoiding the stack depth problem just mentioned.
-
Cricket can have one “background task.” This task repeatedly checks a condition. When this condition becomes true, the task interrupts foreground activity and processes its special action. When the background task's action finishes, execution picks up where it left off in the foreground activity.
-
The action executes exactly once each time the condition goes from false to true
-
-
31 Jan 05
David CorkingThe Cricket has a built-in Cricket Logo byte-code interpreter, for the Cricket Logo compiler. It has tail call elimination
-
Please note that the memory for keeping track of recursive calls during execution is quite small, and limited to perhaps six calls deep. If the stack overflows, the Cricket halts and beeps five times. “Tail recursion” is a special case of recursion when the very last instruction at the end of a procedure is the recursive call. The Cricket supports tail recursion, converting the recursive call into a goto statement,
-
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.