Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANAVI Knobs 3: Support SSD1306 I2C OLED Display #1070

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/anavi/knobs3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Extensions enabled by default:
- [Encoder](/docs/en/encoder.md) Twist control for all the things
- [RGB](/docs/en/rgb.md) Light it up (for underlighting)
- [MediaKeys](/docs/en/media_keys.md) Control volume and other media functions
- [Display](/docs/en/Display.md) Show information on the mini OLED display
18 changes: 16 additions & 2 deletions boards/anavi/knobs3/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 Knobs 3\n\nKMK Firmware'),
],
height=64,
)
knob.extensions.append(display)

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

media_keys = MediaKeys()
Expand All @@ -26,8 +42,6 @@
)
knob.modules.append(encoder_handler)

print('ANAVI Knobs 3')

rgb = RGB(
pixel_pin=board.NEOPIXEL,
num_pixels=1,
Expand Down
Loading