WebBrick JavaScript API 1.0

This will not work until you copy the file and change the URL to be the URL of your WebBrick server.

These are a set of functions that provide an interface to the more powerful features of WebBrick. It is intended for more advanced web application developers who need fine control over WebBrick. The API includes a task queue, which allows tasks to be executed in several different ways. Tasks can be stacked up on the queue, to execute in sequence. This is useful when you want to do things in a specific order, for example, you can set a variable before you run a program. You can also have tasks be blocked if there is anything in the queue. You can use this mode if you do not want many instructions to pile up faster than your RCX can respond, for example, when the user keeps mashing on a UI button. You can also have tasks clear out the queue and run immediately. This is useful when you want the fastest feedback possible, for example, on an emergency stop button.

I have tried to make this code compatable across browsers that support JavaScript. It should work equally well on IE, Netscape, and most early versions of JavaScript. The API is in the top of this file. Additional JavaScript is appended for the demo below. The demo illustrates some of the interactive features. This works with WebBrick 2.3 and up.


Sensors

Port Type Mode Value
Sensor 1
Sensor 2
Sensor 3

Motors

Port On/off Speed Direction Float
Motor A
Motor B
Motor C

Programs and Tasks

Prog Task
1
2
3
4
5

Variables

Var Value

RCX Uptime

Hours Minutes