John Knoll
Member
I'm working on a project that uses one of these SSD1309 I2C OLED displays: https://www.ebay.com/itm/I2C-2-42-128x64-Graphic-OLED-Yellow-Display-SSD1309-Arduino-PIC-Multi-wii/201468080188?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
I hooked it up to a Teensy LC for testing and it works as expected.
My final project uses a Teensy 3.6. Running this exact same code on the 3.6 it reports no errors, but the display does not light up. A voltmeter reports the same voltage at the display in both cases: 3.27V
Any idea why this works on the LC but not the 3.6?
I hooked it up to a Teensy LC for testing and it works as expected.
My final project uses a Teensy 3.6. Running this exact same code on the 3.6 it reports no errors, but the display does not light up. A voltmeter reports the same voltage at the display in both cases: 3.27V
Any idea why this works on the LC but not the 3.6?
Code:
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,19,18, U8X8_PIN_NONE);
void setup()
{
Serial.begin(9600);
Serial.println("Starting.");
// init the OLED display
if (!u8g2.begin()) Serial.println("Failed to connect.");
else Serial.println("Begin succeeded");
}
uint8_t m = 24;
void loop()
{
int j,k;
char m_str[3];
strcpy(m_str, u8x8_u8toa(m, 2)); /* convert m to a string with two digits */
u8g2.setFont(u8g2_font_finderskeepers_tf);
u8g2.clearBuffer();
u8g2.drawStr(0,10,"Hello World!");
u8g2.drawStr(0,63,"9");
u8g2.drawStr(9,63,":");
u8g2.drawStr(12,63,m_str);
for (j = 0; j < 128; j++)
{
u8g2.drawPixel(j, 24 + j%32);
}
u8g2.sendBuffer();
delay(1000);
m++;
if ( m == 60 )
m = 0;
}