Hi Neal. Suggest you click "report to moderator" and ask for your topic to be moved to the displays section, you should get help there. But also read the forum guide and add code tags to your post. After all, does your code contain a winking face emoji? That's what happens if you forget the code tags.
Have you tried the i2c scanner sketch, to see if the Arduino can see the display on the i2c bus and at the address you expected?
Using Uno and Adafruit ssd1306 with the following connections:
Adafruit VIN==>Uno 5v
Adafruit GND==> Uno Gnd
Adafruit SDA==> Uno A4
Adafruit SCL==> Uno A4
I have no output from the ssd1306
I'm using the following code:
Thanks
NealA
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
What I meant was, modify your original post and put the code tags there.
So you found the i2c scanner sketch. What was the output on serial monitor? (Please do not post an image of serial monitor, copy the text from there and paste it into your next post between code tags.)
Adafruit VIN==>Uno 5v
Adafruit GND==> Uno Gnd
Adafruit SDA==> Uno A4
Adafruit SCL==> Uno A4
No i2c detected
Hardly surprising when you can't spell VCC and you connect the wrong pin to SCL.
Most SSD1306 modules have GND, VCC, SCL, SDA clearly marked.
Uno boards have GND, 5V, SDA, SCL clearly marked.
Yes, there are unusual displays. e.g. with slightly different pin names.
That is why it is always wise to post a link to the actual display that you bought.
This avoids your readers having to guess. And usually means that you get an accurate answer within an hour or two.
David.
p.s. we all make typos. you can always correct your own posts.
I am using the following Adafruit SSD1306 OLED with an Arduino Uno:
I have the following:
Adafruit VIN==>Uno 5v Adafruit GND==> Uno Gnd Adafruit Data==> Uno A4 Adafruit Clk==> Uno A5
I used I2C scanner and get "No I2C devices found"
I am using the following I2C Scanner
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
Are you using the connectors on the top of the module or the 4 pin connectors on the side/back? Did you solder the pin headers? Did you connect the RST pin?
Most people buy 4-pin I2C displays e.g. from Ebay, AliExpress, ... pins marked GND VCC SCL SDA Slave=0x3C. (always I2C but you can often select 0x3C / 0x3D )
There are also 7-pin SPI displays. (you can change some of these modules to I2C)
Using the pins on top. Pins soldered. Using breadboard. Tried with & without RST to Digital 4. Still reading "No 2C detected" on serial monitor when using the I2C scanner sketch. LED on Adafruit OLED is on.
Seriously, there are only 4 wires. You can't go far wrong. Especially with soldered pins and good quality jumper cables.
Just run the standard ssd1306_128x64_i2c.ino example sketch. And replace one wire at a time.
Since you have the power LED showing, GND and VCC wires must be good.
You only have to replace the SDA wire and the SCL wire.