Skip to content

Commit

Permalink
boards/anavi/knob1/code.py: Add display
Browse files Browse the repository at this point in the history
Add a new feature to support a mini OLED I2C SSD1306 display.

Signed-off-by: Leon Anavi <[email protected]>
  • Loading branch information
leon-anavi committed Jan 3, 2025
1 parent 9a0cbe1 commit 401d641
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions boards/anavi/knob1/code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import board

from kmk.extensions.display import Display, TextEntry
from kmk.extensions.display.ssd1306 import SSD1306
from kmk.extensions.media_keys import MediaKeys
from kmk.extensions.RGB import RGB, AnimationModes
from kmk.keys import KC
Expand All @@ -8,6 +10,20 @@
from kmk.scanners.keypad import KeysScanner

knob = KMKKeyboard()

# I2C pins for the mini OLED display
knob.SCL = board.D5
knob.SDA = board.D4

display = Display(
display=SSD1306(sda=board.D4, scl=board.D5),
entries=[
TextEntry(text='ANAVI Knob 1\n\nKMK Firmware'),
],
height=64,
)
knob.extensions.append(display)

knob.matrix = KeysScanner([], value_when_pressed=False)

media_keys = MediaKeys()
Expand Down

0 comments on commit 401d641

Please sign in to comment.