4 hours ago
- Gpiozero is a Python library for Raspberry Pi that simplifies GPIO programming by focusing on devices like buttons and LEDs instead of low-level electrical details.
- The library supports three programming paradigms: procedural (looping), event-based (callbacks), and declarative (linking device states via source/values).
- Gpiozero uses standard value ranges for devices (e.g., 0–1 for LEDs, -1–1 for motors), enabling direct value stream connections and manipulations.
- Functions like negated, smoothed, and sin_values allow easy manipulation and combination of value streams between devices.
- The gpiozero-flow project is a web-based UI that lets users drag-and-drop GPIO devices, connect them, and simulate or control them, inspired by gpiozero's source/values model.
- Features include a Python code generator, remote GPIO control via websockets (with HTTPS workaround using local packaging), and support for add-on boards, composite devices, and shareable canvas configurations.
- The tool is experimental, aimed at computational thinking or systems/control education, rather than advanced programming; potential extensions include event-based support and custom generators.