mcp23017_scanner
Scan a matrix keyboard with an API modelled after the keypad module
Author(s): Neradoc
Implementation Notes
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- class mcp23017_scanner.Event(key: int, pressed: bool, timestamp: int = None)
A key transition event.
- Parameters:
key_number (int) – the key number
pressed (bool) –
Trueif the key was pressed;Falseif it was released.timestamp (int) – The time in milliseconds that the keypress occurred in the
supervisor.ticks_mstime system. If specified as None, the current value ofsupervisor.ticks_msis used.
- key_number
The key number.
- pressed
True if the event represents a key down (pressed) transition. The opposite of released.
- property released: bool
True if the event represents a key up (released) transition. The opposite of pressed.
- timestamp
The timestamp.
- class mcp23017_scanner.EventQueue
A queue of Event objects, filled by a scanner.
- class mcp23017_scanner.McpKeysScanner(mcp: any, pins: Iterable[int], irq: Pin | None = None)
Class to scan a key per pin of the MCP chip.
Pins 0-7 are on port A. Pins 8-15 are on port B.
- class mcp23017_scanner.McpMatrixScanner(mcp: any, row_pins: Iterable[int], column_pins: Iterable[int], irq: Pin | None = None)
Class to scan a matrix of keys connected to the MCP chip.
Columns are on port A and inputs. Rows are on port B and outputs.
- class mcp23017_scanner.McpScanner(mcp: any, irq: Pin | None = None)
Base class for MCP scanners.