Homehw​.s‑ol.nu

low-profile hexagon keyboards.

config.py reference

When the board is in dev mode, the config.py file can be changed to set advanced settings that are not available from the interface.

dev mode

dev mode can be enabled permanently by setting the dev_mode variable to True. Whatever the setting is, it can be overriden for a single boot by holding the menu key down while starting, which will invert the setting.

SysEx key sync

SysEx key-press synchronization can be enabled by setting the sysex_key_sync variable to True. See the simulator section on the firmware hacking page for more information.

board parameters

The board parameters configure and select the hardware that is used (pin assignments, key matrix layout). Generally the board parameters are loaded from one of the default board configurations in the hex33board/boards directory as seen below. However any values defined there can be overriden when the board is modified or the firmware is run on different hardware.

from hex33board.boards.r3_5e4bf5c import *

The board parameters are:

  • Keyboard:
    a class to instantiate to start firmware execution. The constructor will be passed the config module as the only argument. After instantiation, keyboard.run() will be invoked.

    This should usually simply be hex33board.Keyboard.

  • create_matrix(board):
    a function to instantiate a key matrix object. The returned object should implement a scan_for_changes() generator method that yields (int, bool) tuples of the pressed key indices and the value they changed to when the state changes.
  • create_pixels(board, **kwargs):
    a function to instantiate a neopixel.NeoPixel-like object for RGB lighting
  • create_display(board, **kwargs):
    a function to instantiate a displayio.Display-like object for the main display
  • create_midi_usb(board), create_midi_trs(board):
    functions to instantiate adafruit_midi.MIDI ports
  • create_audio_out(board):
    a function to instantiate a audiopwmio.PWMAudioOut-like object
  • create_i2c(board, **kwargs), create_i2ctarget(board, **kwargs):
    functions to instantiate busio.I2C and i2ctarget.I2CTarget instances