Built-in packages
GPIO
Directly reads or drives a single digital pin on the board.
Directly reads or drives a single digital pin on the board. Use this when no more specific component (Servo, etc) fits what you're wiring up.
@henglosio/component-gpiov1.0.0platform ^1.0.0
| Node | Kind | What it does |
|---|---|---|
| Pin Trigger | Trigger | Runs its branch when a pin changes — a button pressed, a sensor going high. |
| Write | Action | Sets the pin as output and drives it to the given digital value. |
| Read | Action | Sets the pin as input and reads its current digital value. |
Triggers
Pin Trigger
Runs its branch when a pin changes — a button pressed, a sensor going high.
A trigger: no input, one Out — the first action of its branch.
Settings
| Setting | Type | Default | What it's for |
|---|---|---|---|
| Pin | Pin (digital in) | — | Required. The pin to watch. |
| Edge | One of: Rising (low → high), Falling (high → low), Both | Rising (low → high) | Which change fires it. |
| Pull | One of: None, Up, Down | None | The board's internal resistor — Up for a button wired to ground. |
| Debounce | Number | 50 | Changes closer than this to the last one are ignored (a button bounces), in ms. |
Publishes
| Output | Type | What it is |
|---|---|---|
level | bool | The pin right after the change. |
at | int | When it changed — the board's clock, in ms. |
Actions
Write
Sets the pin as output and drives it to the given digital value.
Settings
| Setting | Type | Default | What it's for |
|---|---|---|---|
| Pin | Pin (digital out) | — | Board pin this GPIO instance controls. |
| Value | On / off | Off | Value of GPIO send. |
Publishes
| Output | Type | What it is |
|---|---|---|
value | bool | The digital value that was written (0 = LOW, 1 = HIGH). |
Read
Sets the pin as input and reads its current digital value.
Settings
| Setting | Type | Default | What it's for |
|---|---|---|---|
| Pin | Pin (digital in) | — | Board pin this GPIO instance controls. |
Publishes
| Output | Type | What it is |
|---|---|---|
value | bool | The digital value read from the pin (0 = LOW, 1 = HIGH). |