PiPLC Example Documentation¶
Detailed walkthroughs for PiPLC example projects. Each document explains the ladder logic rung by rung, covers the I/O map, and provides customization ideas.
For the example project files themselves, see the examples/ directory.
Examples¶
SCRIPT Instruction Examples¶
| Example | Difficulty | Description |
|---|---|---|
| Data Logger with Anomaly Detection | Intermediate–Advanced | Logs sensor readings to SQLite and uses statistical analysis to detect anomalous power consumption. Demonstrates INTERVALMS periodic sampling, SCRIPT for database access, and latch/unlatch alarm patterns. |
State Machine Examples¶
| Example | Difficulty | Description |
|---|---|---|
| 4-Digit Code Lock | Intermediate | A combination lock implemented as a state machine using latch/unlatch bits. Demonstrates one-shot (OSR) edge detection, input lockout during output, atomic state transitions, and TON timers for timed LED display. |