Every firmware image starts with core words, target-native words, board constants, and a small Frothy source library. This page is the map of that ready-to-use layer.
First Example
gpio.output: $led_builtin
led.blink: 3, 75
adc.percent: $a0
The constants let the same source describe intent without copying pin numbers. The helpers are ordinary Frothy words layered over the raw native surface.
Board Constants
| Name | Meaning |
|---|---|
$led_builtin | Built-in LED pin |
$led_active_level | Electrical level that turns the built-in LED on |
$boot_button | Board boot-button pin |
$a0 | Default analog input |
$sda | Default I2C data pin |
$scl | Default I2C clock pin |
The two supported ESP32 board definitions install the same names but may bind them to different pin numbers or LED polarity. Use the names unless the circuit requires a specific pin.
GPIO Helpers
The raw primitives are gpio.mode, gpio.write, and gpio.read. The source
library adds intent-revealing wrappers:
gpio.output: 4
gpio.high: 4
gpio.toggle: 4
gpio.low: 4
gpio.input: 4
pin
is an alias for gpio.write.
Built-In LED Helpers
The LED helpers account for the board’s active level:
led.on:
led.toggle:
led.off:
led.blink: 3, 75
Use blink: pin, count, wait_ms when you want the same behavior on another
pin.
ADC, Math, And Random Helpers
The source library also installs:
adc.percent, mapping a raw 0–4095 read to 0–100wrap, safe modulo for cyclic indexessign, producing -1, 0, or 1random.chance?andrandom.percent?
These definitions live in the base image and can be inspected on the device:
see led.blink
see adc.percent
Go to GPIO & ADC for the electrical I/O contract or the word catalog for every exact signature.