SSD1306Ascii icon indicating copy to clipboard operation
SSD1306Ascii copied to clipboard

Is there any function that returns data from the display? (to verify the display is somewhat functional in init)

Open JonRobert opened this issue 1 year ago • 1 comments

Does the display controller return any data or indication that it is functioning? I realize in most cases you can just look at the display, however I'm considering the design of a remote device that will be subject to power outages. I would like to know if the OLED at least thinks its working.

BTW I've been using your SSD1306 library and have been very happy with it. I really appreciate the basic premise of compactness.

John

JonRobert avatar Jun 19 '23 00:06 JonRobert

The SSD1306 is a write only device. You can see if it responds to the following sequence if you are using a Wire device.

Here is the test:

#include "Wire.h"
// 0X3C+SA0 - 0x3C or 0x3D
#define I2C_ADDRESS 0x3C

bool hasDevice(uint8_t i2cAdd) {
  Wire.beginTransmission(i2cAdd);
  return Wire.endTransmission() == 0;
}

void setup() {
  Serial.begin(9600);
  Wire.begin();
  if (hasDevice(I2C_ADDRESS)) {
    Serial.println("has device");
  } else {
    Serial.println("no device");
  }
}
void loop() {}

It doesn't give much information. I have modules that pass this test but don't display anything.

greiman avatar Jun 19 '23 12:06 greiman

Thank you

JonRobert avatar Jan 30 '24 23:01 JonRobert