jbienzms / iot-devices

Helper library for interfacing with devices in IoT projects.
45 stars 17 forks source link

SSD1306 with SH1106 oled? #12

Open karmaecrivain94 opened 7 years ago

karmaecrivain94 commented 7 years ago

I'm trying to get the ssd1306 library to work with a 128x64 sh1106 oled screen, but I can't seem to get it to work. I've just got a black screen. Is there something wrong in the way I'm setting it up, or is it something else?

            SSD1306 ssd1306 = new SSD1306();
            ssd1306.ChipSelectLine = 0;
            ssd1306.ControllerName = "SPI0";
            ssd1306.DataPin = gpio.OpenPin(22);
            ssd1306.AddressMode = SSD1306AddressMode.Page;

            ssd1306.Width = 132; //This is because the SH1106's internal RAM is 132x64, even for a 128x64 screen.
            ssd1306.Height = 64;
            ssd1306.PixelsPerPage = 1056; //There are 8 pages, so (132*64)/8=1056.

            ssd1306.PixelFormat = Microsoft.IoT.DeviceCore.Display.DisplayPixelFormat.OneBit;
            await ssd1306.WritePixelAsync(10, 10, Colors.White);
            await ssd1306.UpdateAsync();

(I haven't specified the reset pin, as there isn't any on the specific OLED I'm dealing with).

jbienzms commented 7 years ago

Sorry for taking so long but I finally have some time to look at these issues. Did you ever find a workaround? I don't have this particular display so I don't know how well I'll be able to help troubleshoot this, but I wanted to see if you'd made any progress.