All Cricket devices have a built-in bidirectional infrared communications channel, which is used for Cricket-to-desktop communication (when downloading programs to a Cricket, or viewing sensor data) and Cricket-to-Cricket communication.
16More
MetaCricket: A designer's kit for making computational devices - 0 views
-
Cricket Logo is based on an iterative, interactive model of project development. It includes a “command center” window; instructions typed into this window are instantaneously compiled, downloaded to a Cricket, and executed, giving the system the flavor of an interpreted software environment such as LISP, BASIC, or FORTH.
-
The MetaCricket software system is based on a virtual machine, written in PIC assembly language and running on the Cricket, and a compiler for the virtual machine running on a desktop development computer
- ...13 more annotations...
-
It is straightforward to implement an interpreter-like interface, where user commands are transparently compiled, downloaded, and executed.
-
Built-in infrared communications routines include a protocol for reading and writing to this external EEPROM, and for asking the virtual machine to begin execution of byte codes already loaded into the EEPROM.
-
Users write programs for the Cricket in Cricket Logo, a dialect of Logo specialized for the Cricket virtual machine. Essentially, there is a one-to-one mapping between statements in Cricket Logo and primitive functions built into the virtual machine. This makes the implementation of the compiler far simpler than typical compilers.
-
The compiler includes an interactive mode—a text window where user expressions are compiled, downloaded, and executed in one step when the user presses the return key. A portion of the Cricket's memory is set aside for these dynamic programs.
-
we have found that a debugger is not necessary because of the interactive and incremental style of project development that occurs when using the Cricket.
-
The infrared protocol includes the following capabilities: Check that a Cricket is present and ready for other commands. Write a byte to the Cricket's EEPROM. Read a byte from the Cricket's memory. Begin program execution from a particular memory address.
-
User-level primitive functions compile to one, two, or three bytes of object code for the Cricket virtual machine.
-
The Cricket virtual machine has two process threads: a foreground process and a background daemon. In most Cricket programs, the foreground thread handles all the work, but for some tasks, the background daemon is valuable. For example, the background daemon can be used to instigate a periodic activity, or take action when some event occurs.
-
There are hardware-specific primitives for interacting with on-board Cricket hardware. Motor commands set state (on or off), direction, and power levels for each of the two integrated motor drivers. Analog sensor primitives (sensora and sensorb) return a value (0 to 255) for each of the two voltage inputs. These inputs also may be interpreted as digital values using the switcha and switchb primitives. There is a pair of primitive functions for generating tones on the piezo beeper: beep and note, the latter taking pitch and duration arguments.
-
One foreground thread plus one background daemon Daemon fires when provided Boolean expression makes false-to-true transition
11More
RoboLogo - Teaching Children how to program Interactive Robots - 0 views
-
All of the procedures take a discrete ``gear'' to specify the speed. The reasons for this are two-fold; first, by limiting the power of the truck, we simplify the interface to children. Secondly, it allows use to calibrate the ``gears'' so that, for example, 10 seconds forward in first gear is the same distance as 10 seconds backward in first gear.
-
The limitation of LOGO however is the lack of feedback from the environment. There is no way of expressing an event occuring in the outside world.
-
Simple constructs in iLogo extend the original LOGO language with interactivity capabilities of reading sensors and transfering control to different parts of the program.
- ...6 more annotations...
-
These above rules handle all of the commands and expressions of the iLogo language except for the DoUnlessCommand. This command will execute a list of commands unless a boolean condition is met. If so, control is switched to a new list of commands for handling the exception condition.
-
Each stage of the compiler is designed using the Visitor pattern described in the book Design Pattern by Eric Gamma, et al. This pattern allows tree traversers to be created as seperated objects, instead of doing all traversals as methods of the nodes of the tree
-
We decided to use the JavaCC/JJTree tools created by Sun for generating a custom parser for our iLogo language written in Java.
-
The language must have primitives which allow the user of the language to write programs which easily transfer control based upon outside stimuli, in this case sensors on the truck.
-
An LM18293 push-pull motor driver connects the programmable counter array (PCA) of the 8051 to the truck's motors.
-
We took the Berkeley Logo language design as our base and then added a primitive for reading sensor and an exception-based control structure.
6More
Getting Started With Crickets - 0 views
-
You can type any Cricket Logo instruction in the Cricket Logo Command Center, and it will be immediately transferred to the Cricket and executed.
- ...3 more annotations...
-
You can send information from the Motor/Sensor Cricket back to the computer using the send instruction.