writePin
Canonical ID: gpio.write. Nederlands: schrijfPin.
A pin is a connection for a signal. GPIO means general-purpose input/output; BCM is the GPIO numbering scheme, not the order of pins on the connector. In the interpreter and browser these pins are virtual, with pretend states stored by Pliro. Only an explicit native Raspberry Pi target accesses physical pins. Configure means choose input or output before using a pin. See GPIO and circuit words.
Sets a configured output to a Boolean logical level. A Number such as 1 is not a substitute for true. Reading that output later reports the last successfully written logical value. A wrong mode, unconfigured pin, or unavailable physical line yields a diagnostic rather than silently changing mode.
Signature
writePin(pin, value)
Arguments
| Parameter | Type | Requirement |
|---|---|---|
pin |
Number | Whole BCM GPIO number 0–27; not the physical connector position. |
value |
Boolean | true for high, false for low. |
Return value
None.
Example
# language: en
pinOutput(17)
writePin(17, true)
wait(0.05)
writePin(17, false)
Produces one short virtual or physical output pulse.
Notes and common mistakes
Use the function name for your source language. Its canonical ID is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented arguments and value types. Pliro reports mismatches when checking can detect them, or when the call runs.
BCM numbers differ from physical header positions. Test in the virtual workbench before a physical Pi export. Follow the board manufacturer’s electrical guidance for resistors, pull-ups/pull-downs, and voltage levels. Missing physical capability or line access is reported as a diagnostic; an entitlement is not permission to access hardware.
Related entries
pinOutput · pinInput · readPin · Programming guides · Host support · Calls and arguments
