ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2k stars 638 forks source link

Not Working??!! #226

Closed Serg069 closed 4 years ago

Serg069 commented 5 years ago

Hi guys, just installed the library and I am experimenting a few issues that does not able the Oled to run. I have a 0.96" 128x64 SPI Oled screen conected to a Wemos D1 mini. The pins that I am using are as below;

// Initialize the OLED display using SPI // D5 -> CLK // D7 -> MOSI (DOUT) // D0 -> RES // D2 -> DC // D8 -> CS // SSD1306Spi display(D0, D2, D8);

I have installed this library into my: Documents\Arduino\libraries\esp8266_oled_ssd1306

Also installed the Adafruit_GFX library: Documents\Arduino\libraries\Adafruit_GFX

As I am using the SPI board, I have unmmuted the code as explained in the instructuons, see below;

// Include the correct display library // For a connection via I2C using Wire include //#include // Only needed for Arduino 1.6.5 and earlier //#include "SSD1306Wire.h" // legacy include: #include "SSD1306.h" // or #include "SH1106Wire.h", legacy include: #include "SH1106.h" // For a connection via I2C using brzo_i2c (must be installed) include // #include // Only needed for Arduino 1.6.5 and earlier // #include "SSD1306Brzo.h" // #include "SH1106Brzo.h" // For a connection via SPI include

include // Only needed for Arduino 1.6.5 and earlier (UNMMUTED)

include "SSD1306Spi.h" (UNMMUTED)

// #include "SH1106SPi.h"

// Use the corresponding display class:

// Initialize the OLED display using SPI // D5 -> CLK // D7 -> MOSI (DOUT) // D0 -> RES // D2 -> DC // D8 -> CS SSD1306Spi display(D0, D2, D8); (UNMMUTED) // or // SH1106Spi display(D0, D2);

// Initialize the OLED display using brzo_i2c // D3 -> SDA // D5 -> SCL // SSD1306Brzo display(0x3c, D3, D5); // or // SH1106Brzo display(0x3c, D3, D5);

// Initialize the OLED display using Wire library SSD1306Wire display(0x3c, D3, D5); // SH1106 display(0x3c, D3, D5);

When it comes to compiling the latest line shown, "SSD1306Wire" it says does not name a type. Then UNMMUTED the line on the top of the code...

include "SSD1306Wire.h" // legacy include: #include "SSD1306.h" (UNMMUTED)

The file now compiles fine and I uploaded to the Wemos mini but the Oled does not run.

Not sure what makes it not to run, as I have been playing with libraries directories and everything that I could thought but couldn't make it to run. BTW I am using the Drawing Demo.

Thanks

TAz00 commented 5 years ago

I'd like to say I'm having the same problem. The display works fine in SPI mode, confirmed with adafruit lib, although I'm using a nodemcu ESP8266.

`// If using software SPI (the default case):

define OLED_MOSI D7 //D1 NodeMcu D7

define OLED_CLK D5 //D0 NodeMcu D5

define OLED_DC D4

define OLED_CS D8

define OLED_RESET D6

Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);`

I've tried a couple of the examples and fixed the pins, but I can't get anything with the following //#include "SSD1306Wire.h"

include

include "SSD1306Spi.h"

SSD1306Spi display(D6, D4, D8); //RESET, DC, CS //SSD1306Wire display(0x3c, D3, D5);

emilekm2142 commented 5 years ago

Change 0x3c to 0x3d. The code was written to run on nodemcu, not wemos. Change Pins to D2 and D1 - http://automatedhome.party/wp-content/uploads/2017/04/WemosOLED.png

The setup should be fine now, but it is does not work for me. Does it for you?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.