Adafruit SSD1306 Library [Ported]

See the same problem with “” include…

mippen, I must have been asleep when I ported that demo code! Grab that file again from my github and it will work now. Geesh! :open_mouth:

Yay… Works great with the spi example now… Thanks!

1 Like

Thanks for all the legwork that has been done.

So, i figured out tabs within projects, cool…thanks (I assume their compiled and downloaded within main .ino file) ?

@peekay123 I have compiled and downloaded your work, seems to verify and download to core, however, i’m getting nothing on oled display.

First thing, when i have been downloading to core, it then shuts me out and i cant communicate to it, i can reset and re-communicate, but again, i download the code and it locks up with comms from that point.

anyhow, do i have the correct connections on Spark for I2C ?

Pin 0 & 1, D0 & D1. or RX/TX on shield shield ? This would be Data & Clock, right ?

I know oled address is correct, verified from working arduino on I2C program on different setup.

thanks for help.

BusterSpark, when I see RX/TX and I2C I get worried! The I2C standard uses SDA/SCL for data and clock and Serial communciations uses RX/TX for send and receive! So, in your case, the Spark pins don’t map directly to the shield shield pins. If you look at the documentation, pin 3 on the shield shield is Spark pin D0 and pin 5 is Spark pin D1.

BTW, I assume you have a 5V SSD1306 module and that is why you are using the shield shield to translate the voltage levels, correct?

peekay123,

lol, got worried myself when i chose I2C.

Per my last comment, looks like Spark were doing a lot of upgrade stuff today, which could explain IDE taking approx 45 seconds to download to core.

Back to SSD1306, (I have a Adafruit 3.3v/5v Device)

My core is mounted in shield, so i have 3.3v or 5v available for display.
As soon as i read your comment, i was checking into pin assignment.

Yes, i was using RX/TX, but have now switched to D0 and D1 (so 3 & 5 on shield shield)

either way i get nothing, trying to use I2C.

cant get adafruit splash screen, have tried rx/tx pins before switching to shield shield 3 & 5, but no result.

no errors reported anywhere in IDE .

oh the fun getting something working, lol

ps, did find one thing. your Github file for Adafruit_SSD1306.h has a default display address which is not consistent.

Buster Spark, you still have not told me which model of SSD1306 you have and Adafruit has 4 different ones! Please throw me a bone! :smile:

The Adafruit SSD1306 Display that i’m using is the ‘Monochrome 1.3" 128x64 Part #938’

BusterSpark, I need to ask some (possibly obvious) questions:

  1. Did you solder jumpers SJ1 and SJ2 on the back of the board to select I2C mode?
  2. Did you verify SSD1306 Data connects to D0 (SDA) on Spark
  3. Did you verify SSD1306 Clk connects to D1 (SCL) on Spark
  4. Did you verify SSD1306 CS connects to pin on Spark specified in your Adafruit_SSD1306 oled(pin) object creation code?
  5. Are you powering the SSD1306 from the Spark 3.3V line?
  6. Did you select the correct I2C address in Adafruit_SSD1306.h based on display type and if SA0 on the board is grounded?

Let me know what you find. :smile:

Peekay123

1 Yes. I have display running using I2C from Arduino Uno
2 Yes, (wired direct to Spark D0 pin)
3 Yes. (wired direct to Spark D1 pin)
5 No, 5v from Spark Shield Shield
6 Yes. used 0x3D for 128x64 display (line 27 in Adafruit_SSD1306.h

As for question #4, i’m not sure what this pin is. I have not used CS before for I2C comms. Which file do i need to edit for this ?

attached is an image…

Oops, I meant RST not CS!!! The RST is specified in the Adafruit_SSD1306 oled(pin) call in the demo code. This is the reset pin.

BTW, why do you feel you need the shield shield for this. The display can be powered from the 3.3v line since it only needs about 20ma. The Adafruit tutorial for this unit says:

The OLED is designed to be 5V compatible so you can power it with 3-5V and the onboard regulator will take care of the rest.

All OLEDs are safe to use with 3.3V logic and power.

Are you running a demo program? If so, which one?

I’m using the Shield Shield because i have it, and have been experimenting a lot.
I thought you meant reset, and yes, i have it on pin 4.

So, back to drawing board. Looks like wiring is good.

Any other suggestions as to how to get this to work ?

My working setup looks like this:

1 Like

Mippen, can you share your wiring setup?

Setup looks like:

#define OLED_MOSI   D0
#define OLED_CLK    D1
#define OLED_DC     D2
#define OLED_CS     D3
#define OLED_RESET  D4
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);


Mippen, excellent soft SPI setup but busterspark is trying to use i2c! :o

According to the spec the display shall be able to handle both spi and i2c.
Perheps try out SPI on the display as an alternative?

The driver chip, SSD1306 can communicate in two ways: I2C or SPI

He has the display working on arduino using i2c but not on the Spark.