0
\$\begingroup\$

i am trying to simulate an 128 x 64 I2C oled screen with arduino but cannot get to work.

I am using the arduino compiler and the libraries adafruit gfx 1.1.5 and adafruit ssd1306 1.1.2 ( light size instead modern ones )

I have tried some codes and the companion examples in hex format but it does not work.

Also I have tried finding the oled the I2C address and no I2C devices found.

UPDATED and solved.

My references

OLED Datasheet

Youtube example

The current schema

My example code

#include <Wire.h>
#include<SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4

Adafruit_SSD1306 display(OLED_RESET);

void setup()
{

Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3D);
display.display();
delay(2000);
display.clearDisplay();

display.drawPixel(40, 10, WHITE);
display.drawPixel(50, 10, WHITE);
display.drawPixel(60, 10, WHITE);
display.display();
delay(2000);

}

void loop()
{
delay(100);
}

current schematic

\$\endgroup\$
5
  • \$\begingroup\$ Debugging questions needs to include meaningful indication of the failure - so for example, this is an I2C interface, are bus operations getting an ACK?. You have the additional issue here that it's not really knowable if the simulation is true to what it purports to model in all cases - it's entirely possible that something that works in the hardware won't in the simulator. \$\endgroup\$ Sep 9, 2020 at 15:40
  • 1
    \$\begingroup\$ Please don't edit your question to include a solution. If it has the property of an answer to your question, add it as answer! It's encouraged to answer your own questions here. \$\endgroup\$ Sep 9, 2020 at 17:19
  • \$\begingroup\$ @MarcusMüller ah, ok \$\endgroup\$
    – ppk
    Sep 9, 2020 at 17:20
  • 1
    \$\begingroup\$ Instead of adding [SOLVED] to the question, please accept the correct answer. \$\endgroup\$
    – jaskij
    Sep 9, 2020 at 17:29
  • \$\begingroup\$ Please make you own answer and mark it as "correct". \$\endgroup\$
    – Arseniy
    Sep 10, 2020 at 6:05

1 Answer 1

0
\$\begingroup\$

The schema was right. I am using I2C interface.

Later I with the comment i discovered the I2C debugger and see what was going wrong. The bus connection was not set up properly.

Once corrected all works as expected.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.