olikraus / u8glib

Arduino Monochrom Graphics Library for LCDs and OLEDs
https://github.com/olikraus/u8glib/wiki
Other
1.25k stars 315 forks source link

SSD1306 u8glib on PRO MICROS #277

Open olikraus opened 9 years ago

olikraus commented 9 years ago

Originally reported on Google Code with ID 278

Hi, i bought a pro micro version of arduino. This version do not come with A4 and A5..
just came with A0 /A1 /A2 / A3. How can i use a OLED display( with four pins ->  VCC(ok),
GND(ok), SCL(?), SDA(?)) with this arduino? It is possible to change de A5 and A4 to
A3 and A2 ?

Arduino
https://www.foxytronics.com/products/257-leonardo-pro-micro
http://www.aliexpress.com/snapshot/6152671168.html

Display
http://www.aliexpress.com/snapshot/6146844733.html

My main email is antenor.d@hotmail.com
thanks in advanced!

Reported by antenordjr on 2014-09-09 00:27:08

olikraus commented 9 years ago
I think SDA is on pin 2 and SCL on pin 3

Reported by olikraus on 2014-09-09 04:58:29

olikraus commented 9 years ago
thanks... and how i say to u8glib that pin 2 and 3 should be used perhaps A4 and A5?

Reported by antenordjr on 2014-09-09 21:56:20

olikraus commented 9 years ago
U8GLIB_SSD1306_128X64 u8g(2,3); ???

Reported by antenordjr on 2014-09-10 01:52:36

olikraus commented 9 years ago
The pin numbers are not important for U8glib (U8glib just taks to the I2C subsystem).
So you can use
U8GLIB_SSD1306_128X64(U8G_I2C_OPT_NONE)
or
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK)

Reported by olikraus on 2014-09-10 06:30:21

olikraus commented 9 years ago
I am successfully using a (cheap/generic eBay) SSD1306 I2C 128x64 OLED display with
the latest U8glib (as of 11/5/2014) on my Arduino Pro Micro.  To make it work just
add this to the top of your .pde:

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK)

...and make sure that you connect SDA to pin 2 and SCL to pin 3.  That's all there
is to it.

FYI: The pinout diagram for the Pro Micro (which shows that pins 2 and 3 are SDA/SCL)
can be found here:  https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro

Reported by riskable on 2014-11-06 15:37:57

olikraus commented 9 years ago
Thanks for providing this additional information.

Reported by olikraus on 2014-11-06 20:41:18