Hello,
I'm getting a compile error when I compile the example Adafruit SSD1331 OLED with "NodeMCU 1.0 ESP12-E". I got the latest SSD1331 and GFX library from Adafruit's github, and modified the define pin values to match the NodeMCU ESP8266 module hardware SPI pins:
#define sclk 14
#define mosi 13
#define cs 15
#define rst 4
#define dc 12
It seems others have had success with the Adafruit OLED library with the ESP8266, so I'm not sure what is causing the compile error. It's one of those errors I just don't know how to interpret. As a side note, the compile is successful if I change the board to Arduino Uno. The error only occurs if the IDE is set to compile for NodeMCU 1.0 ESP12-E. Also a side note, I'm able to get the Adafruit SSD1306 (I2C) OLED with the ESP8266 to compile and run, but not this Adafruit SPI OLED.
Here's the error below. I'm also attaching my example sketch, but it's pretty much just the example from Adafruit's library.
Arduino: 1.8.2 (Windows 7), TD: 1.36, Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (1M SPIFFS)"
C:\Users\main\Documents\Arduino\libraries\Adafruit-SSD1331-OLED-Driver-Library-for-Arduino-master\Adafruit_SSD1331.cpp: In member function 'void Adafruit_SSD1331::begin()':
C:\Users\main\Documents\Arduino\libraries\Adafruit-SSD1331-OLED-Driver-Library-for-Arduino-master\Adafruit_SSD1331.cpp:289:21: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment
sclkportreg = portOutputRegister(digitalPinToPort(_sclk));
^
C:\Users\main\Documents\Arduino\libraries\Adafruit-SSD1331-OLED-Driver-Library-for-Arduino-master\Adafruit_SSD1331.cpp:293:20: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment
sidportreg = portOutputRegister(digitalPinToPort(_sid));
^
C:\Users\main\Documents\Arduino\libraries\Adafruit-SSD1331-OLED-Driver-Library-for-Arduino-master\Adafruit_SSD1331.cpp:305:15: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment
csportreg = portOutputRegister(digitalPinToPort(_cs));
^
C:\Users\main\Documents\Arduino\libraries\Adafruit-SSD1331-OLED-Driver-Library-for-Arduino-master\Adafruit_SSD1331.cpp:308:15: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'PortReg* {aka volatile unsigned char*}' in assignment
rsportreg = portOutputRegister(digitalPinToPort(_rs));
^
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
And here's the link to the Adafruit SSD1331 library:
esp8266_ssd1331.ino (8.67 KB)