Origin was built hardware-first. Where most languages treat GPIO and serial protocols as library afterthoughts, Origin promotes them to top-level language syntax — a single readable line is all it takes to drive a pin HIGH, sweep a servo, or read a byte over I2C. This design philosophy means that embedded scripts stay small, readable, and auditable, with none of the setup boilerplate that accumulates in equivalent Python projects.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/boblio-max/origin/llms.txt
Use this file to discover all available pages before exploring further.
Hardware Namespaces
Origin groups hardware control into five distinct command namespaces, each targeting a different layer of the Raspberry Pi I/O stack:| Namespace | What it controls |
|---|---|
set pin | BCM GPIO output pins — drive HIGH or LOW |
set servo.angle | PCA9685 servo channels via I2C — set angle in degrees |
i2c | Raw I2C register reads and writes via smbus2 |
spi | SPI bus reads and writes |
uart | UART serial reads and writes |
Architecture
Behind the scenes, Origin’s interpreter translates each hardware statement into a Python call during AST-to-Python code generation. The mapping is direct:set pin <n>, <state>→_execute_set_pin(n, state)via RPi.GPIO (BCM mode)set servo.angle <n>, <deg>→_kit.servo[n].angle = degvia adafruit-circuitpython-servokiti2c.read <addr>, <reg>→_execute_i2c_read(addr, reg)via smbus2 — reads 1 byte from registerregi2c.read <addr>, <reg>, <size>→_execute_i2c_read(addr, reg, size)— readssizebytesi2c.write <addr>, <reg>, <data>→_execute_i2c_write(addr, reg, data)via smbus2spi.read <n>→_execute_spi_read(n)spi.write <data>→_execute_spi_write(data)uart.read <n>→_execute_uart_read(n)uart.write <data>→_execute_uart_write(data)
ServoKit instance and GPIO.setmode(GPIO.BCM) configuration.
set pin includes a simulation fallback: on a non-Pi host where RPi.GPIO is unavailable, the runtime prints [SIM] Pin <n> set to <state> instead of raising an error, so you can verify script logic before deployment. The I2C helpers silently return 0 (read) or do nothing (write) when smbus2 is not installed. SPI and UART primitives generate calls to _execute_spi_* and _execute_uart_* helpers — ensure those are present in your runtime environment.Requirements
To use hardware commands in Origin, you need:- Raspberry Pi hardware — any model with GPIO headers (Pi 3, 4, 5, or Zero 2W recommended)
- RPi.GPIO installed (
pip install RPi.GPIO) forset pincommands - adafruit-circuitpython-servokit installed (
pip install adafruit-circuitpython-servokit) for servo control - smbus2 installed (
pip install smbus2) for I2C protocol commands - Interfaces enabled in
raspi-config(I2C, SPI, UART as needed) - Appropriate wiring — current-limiting resistors for LEDs, correct power rails for servos
Quick Reference
Explore the Hardware Docs
GPIO & Pins
Drive Raspberry Pi GPIO pins HIGH or LOW using the
set pin command with BCM numbering.Servo Control
Position PCA9685 servo channels with
set servo.angle and automatic 0–180° clamping.Protocols
Communicate over I2C, SPI, and UART with Origin’s parenthesis-free protocol primitives.