6. Hardware Control¶
Every Python value in the primer lived in memory: a number
named x, a string returned by a function, a list
manipulated by a loop. Hardware control replaces in-memory work
with physical effects – a voltage on a pin, a pulse train on
a wire, a byte clocked into another chip over a bus.
The machine module is the bridge. Its classes
(Pin, ADC,
PWM, UART,
SPI, I2C,
CAN, WDT) each map a piece
of the camera’s silicon to Python: configure an instance, call
its methods, see real effects on the board’s pins.
PWM applications
Pulse-timed I/O
Production patterns
Wrap up