trellism4_extended

CircuitPython library to extended Adafruit NeotrellisM4 board with two Neotrellis seesaw boards (or more !).

  • Author(s): arofarn

Implementation Notes

Hardware:

Software and Dependencies:

class trellism4_extended.NeoTrellisM4(left_part=None)

Driver for the Adafruit NeoTrellis.

Parameters

left_part – None (default) or left part object

Note

if None (or ommitted) the class create a neotrellis.multitrellis-compatible object for the left half of the TrellisM4 board. Else the right part is created and the arguement should be the left part object.

Example:

from neotrellism4 import NeoTrellisM4
trellis_left = NeoTrellisM4()
trellis_right = NeoTrellisM4(left_part=trellis_left)
activate_key(key, edge, enable=True)

Activate or deactivate a key on the trellis

:param int key : key number from 0 to 16. :param int edge : specifies what edge to register an event on and can be NeoTrellis.EDGE_FALLING or NeoTrellis.EDGE_RISING. :param bool enable : should be set to True if the event is to be enabled, or False if the event is to be disabled.

property count

Return the pressed keys count

property interrupt_enabled

Only for compatibility with neotrellis module: Interrupts are disable on trellis M4 keypad

read_keypad(num)

Read data from the keypad

Parameters

num (int) – The number of bytes to read

set_event(key, edge, enable)

Control which kinds of events are set

Parameters
  • key (int) – the key number

  • edge (int) – the type of event

  • enable (bool) – True to enable the event, False to disable it

sync()

Read any events from the Trellis hardware and call associated callbacks.