Skip to content

96x96 SH1107 display not centred #21

@joveaaron

Description

@joveaaron
  • Arduino board: ESP32 (not relevant I think)

  • Arduino IDE version (found in Arduino -> About Arduino menu): 2.3.2 (still don't think it's relevant)

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): DEFAULT SH1107 EXAMPLE WITH WIDTH AND HEIGHT CHANGED TO 96x96 and any other code you try to use.

Hey there, I bought a sh1107 display from aliexpress and it this library didn't work correctly for me at first. I opened "Adafruit_SH1107.cpp" and modified the code in the begin function to pass over these commands to the display:

if (WIDTH == 96 && HEIGHT == 96) {
    static const uint8_t init_96x96[] = {
        SH110X_SETDISPLAYOFFSET, 0x6F, SH110X_SETMULTIPLEX, 0x5F
    };
    if (!oled_commandList(init_96x96, sizeof(init_96x96))) {
      return false;
    }
  }

because the screen was offset and it cut off and I got it to align on the X axis by modifying the SETDISPLAYOFFSET AND SETMULTIPLEX but the Y axis is still unaligned. I have experimented with the commands on the datasheet to see what would happen but I couldn't get it to align on the Y axis.
Pictures:
Before aligning (unmodified library and 96x96 sketch)
WhatsApp Image 2024-06-10 at 19 05 09_fed13a7e
After aligning (modified library and 96x96 sketch, garbled data below is whatever was stored in RAM after powerup, seems to be 16 pixels tall)
WhatsApp Image 2024-06-10 at 19 05 26_c74b6b7e
The display's backside (address is 0x3C not 0x78 lol):
WhatsApp Image 2024-06-10 at 19 08 28_3724246b
WhatsApp Image 2024-06-10 at 19 08 49_e9b02eab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions