Origin makes GPIO output control a first-class language statement. Rather than importing a library, callingDocumentation 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.
GPIO.setmode, and managing GPIO.setup yourself, you write a single line — set pin <n>, <state> — and Origin’s runtime handles the rest. This keeps hardware scripts readable and focused on intent, not infrastructure.
Syntax
n— the BCM GPIO pin number (integer)state—1to drive the pin HIGH,0to drive it LOW
set pin command maps directly to the _execute_set_pin(n, state) runtime helper, which calls RPi.GPIO.output after configuring the pin as an output in BCM mode. You never call GPIO.setup or GPIO.setmode manually.
Basic Examples
Drive BCM pin 12 HIGH (for example, to illuminate an LED or enable a relay):BCM vs BOARD Numbering
Origin always uses BCM (Broadcom) numbering. BCM numbers refer to the GPIO signal line on the Broadcom SoC — they are the numbers printed in pink on most Raspberry Pi pinout diagrams. They are not the physical connector pin numbers (1–40).| BCM | Physical Pin | Common Use |
|---|---|---|
| 17 | Pin 11 | General purpose |
| 18 | Pin 12 | PWM0 / general |
| 27 | Pin 13 | General purpose |
| 22 | Pin 15 | General purpose |
| 12 | Pin 32 | PWM0 |
set pin statement.
Full Example: Blinking an LED
This script blinks an LED connected to BCM pin 17 ten times, with a half-second on and half-second off delay between each cycle.Connect your LED
Wire the long leg (anode) of the LED through a 330 Ω resistor to BCM pin 17 (physical pin 11). Connect the short leg (cathode) to a GND pin (physical pin 6 or 14).
Toggling Multiple Pins
You can control multiple GPIO pins in the same script by callingset pin with different pin numbers:
set pin call is independent — there is no shared state between different pin numbers.
Using a Variable for the Pin Number
The channel argument toset pin can be any expression that evaluates to an integer, including a variable:
Iterating Over Multiple Pins
Use afor loop with range() to iterate over a sequence of pin numbers:
set pin requires the RPi.GPIO Python library. Install it on your Raspberry Pi with pip install RPi.GPIO. On a non-Pi host, the runtime prints a simulation message — for example, [SIM] Pin 17 set to 1 — instead of driving real hardware. This is useful for verifying script logic before deployment.