Skip to content

Setup OLED

tl;dr

Add libraries to your keyboard, set klor_oled = True and customize your OLED text

Necessary libraries

Make sure that you added the two libraries into your keyboard's 'lib' folder:
'adafruit_display_text' (folder) & 'adafruit_displayio_ssd1306.mpy' (file)

Image title

Activate the OLED code

Afterwards you have to change the variable klor_oled from False to True in your main.py file:

klor_variant = "saegewerk"
klor_rgb = "none"         
klor_oled = False          #<- Change this to True
klor_speaker = False      

Customize your OLED text

When you add more layers to your keymap, also add them to this part your OLED code.

You can find the code in your kb.py file:

Example: adding a fourth layer called 'TESTLAYER' to the OLED code:
oled_ext = Oled(
    OledData(
        corner_one={
            0: OledReactionType.STATIC,
            1: ["Layer"],
        },
        corner_two={
            0: OledReactionType.LAYER,
            1: ["0", "1", "2", "3"],
        },
        corner_three={
            0: OledReactionType.LAYER,
            1: ["BASE", "RAISE", "LOWER", "TESTLAYER"],
        },
        corner_four={
            0: OledReactionType.LAYER,
            1: ["qwerty", "nums", "sym", "test"],
        },
    ),
    toDisplay=OledDisplayMode.TXT,
    flip=True,
    # oHeight=64,
) 

Possible Tweaks

The 'SSD1306 128x64 pixel OLED Displays' is not offically supported by KMK, only the '128x32 pixel' version is.

If you want to display photos on your OLED as per this instructions you might need to uncomment # oHeight=64, in the OLED code block.

Warning

Displaying photos on the KLOR's OLED has not been tested and might require additonal code changes.

If you uncomment # oHeight=64, while displaying text the font becomes smaller, so you can display more words, but everything is moved to the top left corner.