Board Words
This is the fast lookup page for workshop and Machine work. Follow a word link for the full behavior card and example.
Display
| Word | Arity | Returns | Use |
|---|---|---|---|
grid.width | 0 | Int | 12-column logical canvas width |
grid.height | 0 | Int | 8-row logical canvas height |
grid.clear: | 0 | nil | Clear framebuffer |
grid.set: | 3 | nil | Set x, y, bool pixel |
grid.get: | 2 | Bool | Read x, y pixel |
grid.toggle: | 2 | nil | Toggle x, y pixel |
grid.rect: | 5 | nil | Draw outline rectangle |
grid.fill: | 1 | nil | Fill all pixels with bool |
grid.show: | 0 | nil | Flush framebuffer |
matrix.init: | 0 | nil | Initialize display |
matrix.brightness!: | 1 | nil | Set brightness |
matrix.show: | 0 | nil | Flush framebuffer |
matrix.clear: | 0 | nil | Clear framebuffer |
matrix.fill: | 1 | nil | Fill framebuffer |
matrix.width | 0 | Int | Display width |
matrix.height | 0 | Int | Display height |
matrix.pixel@: | 2 | Bool | Read pixel |
matrix.pixel!: | 3 | nil | Set pixel |
matrix.line: | 5 | nil | Draw line |
matrix.rect: | 5 | nil | Draw outline rectangle |
matrix.fillRect: | 5 | nil | Draw filled rectangle |
tm1629.populate: | 1 | nil | Fill from fn with x, y |
tm1629.lifeStep: | 0 | nil | Advance Life simulation |
Input
| Word | Arity | Returns | Use |
|---|---|---|---|
joy.up?: | 0 | Bool | Joystick up |
joy.down?: | 0 | Bool | Joystick down |
joy.left?: | 0 | Bool | Joystick left |
joy.right?: | 0 | Bool | Joystick right |
joy.click?: | 0 | Bool | Joystick press |
knob.left: | 0 | Int | Left knob 0..100 |
knob.right: | 0 | Int | Right knob 0..100 |
knob.left.raw: | 0 | Int | Left raw ADC |
knob.right.raw: | 0 | Int | Right raw ADC |
Utilities
| Word | Arity | Returns | Use |
|---|---|---|---|
millis: | 0 | Int | Uptime milliseconds |
ms: | 1 | nil | Sleep milliseconds |
random.below: | 1 | Int | Random 0..n-1 |
math.clamp: | 3 | Int | Clamp to range |
math.wrap: | 2 | Int | Wrap around range |
Base Image
| Word | Arity | Returns | Use |
|---|---|---|---|
LED_BUILTIN | 0 | Int | Built-in LED pin |
A0 | 0 | Int | Board analog pin |
BOOT_BUTTON | 0 | Int | Boot button pin |
gpio.mode: | 2 | nil | Configure pin mode |
gpio.write: | 2 | nil | Write pin level |
gpio.read: | 1 | Int | Read pin level |
gpio.input: | 1 | nil | Configure input pin |
gpio.output: | 1 | nil | Configure output pin |
gpio.high: | 1 | nil | Set pin high |
gpio.low: | 1 | nil | Set pin low |
gpio.toggle: | 1 | nil | Toggle pin |
blink: | 3 | nil | Blink pin by count and delay |
animate: | 3 | nil | Repeat a step function with timing |
led.pin | 0 | Int | Default LED pin |
led.on: | 0 | nil | Turn default LED on |
led.off: | 0 | nil | Turn default LED off |
led.toggle: | 0 | nil | Toggle default LED |
led.blink: | 2 | nil | Blink default LED by count and delay |
adc.read: | 1 | Int | Read raw ADC pin |
adc.max | 0 | Int | Maximum ADC reading |
adc.percent: | 1 | Int | Read ADC pin as 0..100 |
Demos And Puzzle
| Word | Arity | Returns | Use |
|---|---|---|---|
demo.pong.setup: | 0 | nil | Initialize built-in Pong |
demo.pong.update: | 0 | nil | Advance Pong model |
demo.pong.draw: | 0 | nil | Draw Pong frame |
demo.pong.frame: | 0 | nil | One Pong update/draw/sleep frame |
demo.pong.run: | 0 | nil | Run Pong until joystick click |
puzzle.dot: | 0 | nil | Workshop puzzle dot |
puzzle.frame: | 0 | nil | Workshop puzzle frame |
puzzle.scene: | 0 | nil | Workshop puzzle scene |
puzzle.reveal: | 0 | nil | Workshop knob reveal |
Use show @name and info @name on the board for demo and puzzle internals;
those words are teaching examples rather than stable general-purpose APIs.