OLED display 128x64 ADA-938 SPI on Teensy4.0 does not work

Status
Not open for further replies.

ossi

Well-known member
I dont get the ADA-938 OLED display to work with the Teensy4.0. If I use the SSD1306.zip from https://www.pjrc.com/teensy/td_libs_SSD1306.html I get a lot of compiler errors. If I use the newest adafruit ssd1306 library the file compiles fine, but the display does not show any reactions.

Does anyone have experiences with SSD1306 displays on the Teensy 4.0?
 
Yes, just powered up and tested an SSD1306 to work work in recent days. And again now on another T_4.0:
Code:
Using library SPI at version 1.0 in folder: T:\arduino_1.8.10\hardware\teensy\avr\libraries\SPI 
Using library Wire at version 1.0 in folder: T:\arduino_1.8.10\hardware\teensy\avr\libraries\Wire 
Using library Adafruit_GFX at version 1.5.6 in folder: T:\arduino_1.8.10\hardware\teensy\avr\libraries\Adafruit_GFX 
Using library Adafruit_SSD1306 at version 1.3.0 in folder: T:\tCode\libraries\Adafruit_SSD1306

This is on IDE 1.8.10 and TeensyDuino 1.49 Beta 4, all libraries as indicated come from TeensyDuino install except the "(sketchbook)\libraries\Adafruit_SSD1306" is a local copy of the last I got from Adafruit dated here 9/19/19 as that library is not included in TeensyDuino.

The sketch here was edited but moving to this sketch :: ...\libraries\Adafruit_SSD1306\examples\ssd1306_128x64_i2c\ssd1306_128x64_i2c.ino

Requires this change to run where address must be 0x3C not 0x3D: if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64

Since there is no reset pin this change can also be made to that example where ", OLED_RESET" is removed:
Code:
//Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire[U][B], OLED_RESET[/B][/U]);
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);

For fun adding this makes it run faster - and the 'a*10' can be just 'a': #define delay(a) delayMicroseconds( a*10 )

Also indicated in the console output this line needs activated in :: ...\libraries\Adafruit_SSD1306\Adafruit_SSD1306.h:
// ONE of the following three lines must be #defined:
#define SSD1306_128_64 ///< DEPRECTAED: old way to specify 128x64 screen
 
Last edited:
Status
Not open for further replies.
Back
Top