So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Hairyloon
#93152 This ought to be simple.
I want to get inputs off a PCF8591 ADC and display them on an OLED display.
I'm using the thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays, but only because it was the first one I found that worked.
This is the code that I'm using to read the ADC, it seems to work fine.

Code: Select all  Wire.beginTransmission(0x48); // wake up PCF8591
  Wire.write(0x04); // control byte - read ADC0 then auto-increment
  Wire.endTransmission(); // end tranmission
  Wire.requestFrom(PCF8591, 5);
  value0 = Wire.read();
  value0 = Wire.read();
  value1 = Wire.read();
  value2 = Wire.read();
  value3 = Wire.read();

Except that it stops working if I initialise the display:
Code: Select allSSD1306Wire display(0x3c, 5, 4);
display.init();


After that, all my inputs read 128.
What do I need to do different?
User avatar
By Hairyloon
#93194
rpiloverbd wrote:Hello, I think you 'd better use Adafruit_SSD1306.h instead. This library can be used with wire.h without any problem.


I was about to say:
I cannot get that one to work with this module at all.

Then I thought I'd better check everything first: had missed out the space between SDA and SCL in the Wire.begin() function. :oops: