Hi,
I have a project (using Arduino Nano) that only needs to display some alphanumeric texts, like "duty cycle: 80%". Originally I used a 16 X 2 LCD as that's the display I'm most familiar with but now I've realized that display is too large physically. I'm now interested in a small OLED like this:
It's the 4 pin version (Vcc, GND, SCL, SDA). Can any digital pin connect to SCL and SDA? The spec sheet mentions 3.3V - 5V for Vcc. I wonder if I can use the 5V from the Arduino for it?
The search I've found uses libraries like U8g2lib.h or Adafruit_SSD1351.h and I'm really confused on what they are and which one I should use.
Can someone write a simple sketch that just displays 2 short strings on 2 separate lines, please?
Thanks, that's very helpful.
I couldn't figure out where in the source code (the Adafruit version) it specifies that SCL and SDA are A5 and A4. Is it this line:
No, that looks like a display sub-type and I2C address, overides for default kind and address.
SCL and SDA are lower down in Wire or whatever is actually being used to do the I2C stuff.
On the UNO, those signals are done by hardware, when you use the build in I2C those will always be the pins, A4 (look at all those As) DATA and A5 (five letters (hadn't seen that one)) CLOCK.
I2C pins are called out on any decent depiction of a particular Arduino board's pinout.
Doesn't the 3V3 pin on the Uno/Nano outputs 3.3V? Wouldn't it be better to power the OLED from the 3V3 pin rather than 5V as shown in the tutorial since it mentions "Actually, all OLED displays run on 3.3V and power to the board as well as input signals are converted to 3.3V by an on-board voltage converter."
I do not see a difference in supply voltage if it matches the OLED, but lower volts means higher amps. I think the Arduino have a sourcing limit measured in mA.
Each Arduino board has its own SCL and SDA pins. Figure out which are used for your board.
If your curiosity is abject, they are defined in oins_arduino.h, about which you probably do not need to worry. I've never looked at it after all this time.