Close

Display test

A project log for Cruise Control Preset

This project supplements the existing cruise control in a vehicle, allowing you to automatically set the cruise control to a selected speed.

scott-hammerschmidtScott Hammerschmidt 04/08/2015 at 18:170 Comments

Over lunch today I finished hooking up one of the OLED displays to the breadboard shield on my Arduino Uno. While the OLED is supposed to be tolerant of being powered and communicated to with 5v, I've read a few forum posts that seem to indicate that it could be unreliable. I happened to have a bidirectional 3.3V level converter (although from what I understand, the OLED I'm using often only receives and doesn't transmit), so I used that to hook it up.

I first tried with the u8glib library, but their example code (using the No Acknowledge setting) caused nothing to happen on the display. I then followed what this guy did:

His example uses the Adafruit library. I, too, had to change the I2C address to 0x3C for mine. After that, though, it worked (well, after figuring out that my connections were off by one on the level converter).

The example is pretty big, though. It takes about 20k (out of 32k) of flash and 1580 bytes (out of 2048) of RAM. I don't know if I can leave out certain parts of the library that I don't need or maybe the example code uses quite a bit more memory than my code will use.

I may try the u8glib library again now that I know my setup works to see how much memory it takes.

I added pullup resistors to the 5v side of the I2C lines. It worked fine without them (maybe because of the level converter), but I added them just to be sure.

Discussions