This is the fast lookup page for workshop and Machine work. Follow a word link for the full behavior card and example.

Display

WordArityReturnsUse
grid.width0Int12-column logical canvas width
grid.height0Int8-row logical canvas height
grid.clear:0nilClear framebuffer
grid.set:3nilSet x, y, bool pixel
grid.get:2BoolRead x, y pixel
grid.toggle:2nilToggle x, y pixel
grid.rect:5nilDraw outline rectangle
grid.fill:1nilFill all pixels with bool
grid.show:0nilFlush framebuffer
matrix.init:0nilInitialize display
matrix.brightness!:1nilSet brightness
matrix.show:0nilFlush framebuffer
matrix.clear:0nilClear framebuffer
matrix.fill:1nilFill framebuffer
matrix.width0IntDisplay width
matrix.height0IntDisplay height
matrix.pixel@:2BoolRead pixel
matrix.pixel!:3nilSet pixel
matrix.line:5nilDraw line
matrix.rect:5nilDraw outline rectangle
matrix.fillRect:5nilDraw filled rectangle
tm1629.populate:1nilFill from fn with x, y
tm1629.lifeStep:0nilAdvance Life simulation

Input

WordArityReturnsUse
joy.up?:0BoolJoystick up
joy.down?:0BoolJoystick down
joy.left?:0BoolJoystick left
joy.right?:0BoolJoystick right
joy.click?:0BoolJoystick press
knob.left:0IntLeft knob 0..100
knob.right:0IntRight knob 0..100
knob.left.raw:0IntLeft raw ADC
knob.right.raw:0IntRight raw ADC

Utilities

WordArityReturnsUse
millis:0IntUptime milliseconds
ms:1nilSleep milliseconds
random.below:1IntRandom 0..n-1
math.clamp:3IntClamp to range
math.wrap:2IntWrap around range

Base Image

WordArityReturnsUse
LED_BUILTIN0IntBuilt-in LED pin
A00IntBoard analog pin
BOOT_BUTTON0IntBoot button pin
gpio.mode:2nilConfigure pin mode
gpio.write:2nilWrite pin level
gpio.read:1IntRead pin level
gpio.input:1nilConfigure input pin
gpio.output:1nilConfigure output pin
gpio.high:1nilSet pin high
gpio.low:1nilSet pin low
gpio.toggle:1nilToggle pin
blink:3nilBlink pin by count and delay
animate:3nilRepeat a step function with timing
led.pin0IntDefault LED pin
led.on:0nilTurn default LED on
led.off:0nilTurn default LED off
led.toggle:0nilToggle default LED
led.blink:2nilBlink default LED by count and delay
adc.read:1IntRead raw ADC pin
adc.max0IntMaximum ADC reading
adc.percent:1IntRead ADC pin as 0..100

Demos And Puzzle

WordArityReturnsUse
demo.pong.setup:0nilInitialize built-in Pong
demo.pong.update:0nilAdvance Pong model
demo.pong.draw:0nilDraw Pong frame
demo.pong.frame:0nilOne Pong update/draw/sleep frame
demo.pong.run:0nilRun Pong until joystick click
puzzle.dot:0nilWorkshop puzzle dot
puzzle.frame:0nilWorkshop puzzle frame
puzzle.scene:0nilWorkshop puzzle scene
puzzle.reveal:0nilWorkshop 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.