From a6de2663d174ee0ea312596dbf1b22cc02d712e6 Mon Sep 17 00:00:00 2001 From: Oliver Rafelsberger <19696982+Palmstroemen@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:46:20 +0100 Subject: [PATCH 1/3] Added some comment lines for pins used. Took me some time to figure out that the pins differ from board to board. Comments would help. --- examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino b/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino index 812bac0b..e0e13c93 100644 --- a/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino +++ b/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino @@ -27,6 +27,10 @@ #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) +// The pins for I2C are fixed and defined by the Wire-library. +// On an arduino UNO it's: A4(SDA), A5(SCL) +// On an arduino DUE or a MEGA2560 it's: 20(SDA), 21(SCL) +// On an arduino LEONARDO it's: 2(SDA), 3(SCL), ... #define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); From da3965a65a6e3a477e7b67305644b896e604100a Mon Sep 17 00:00:00 2001 From: Oliver Rafelsberger <19696982+Palmstroemen@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:57:10 +0100 Subject: [PATCH 2/3] Added some comment lines for pins used No code-change --- examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino b/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino index 03497858..cd949b3b 100644 --- a/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino +++ b/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino @@ -27,6 +27,10 @@ #define SCREEN_HEIGHT 32 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) +// The pins for I2C are fixed and defined by the Wire-library. +// On an arduino UNO it's: A4(SDA), A5(SCL) +// On an arduino DUE or a MEGA2560 it's: 20(SDA), 21(SCL) +// On an arduino LEONARDO it's: 2(SDA), 3(SCL), ... #define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); From 595c287eeaed69c5f24dfccaa92e5854cc727ca5 Mon Sep 17 00:00:00 2001 From: Oliver Rafelsberger <19696982+Palmstroemen@users.noreply.github.com> Date: Tue, 15 Dec 2020 21:23:09 +0100 Subject: [PATCH 3/3] Added some information about the used pins. A4, A5 on a UNO, 20,21 on a MEGA. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0439dd9..a4ba5adb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a library for our Monochrome OLEDs based on SSD1306 drivers Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98 -These displays use I2C or SPI to communicate, 2 to 5 pins are required to interface. +These displays use I2C or SPI to communicate, 2 to 5 pins are required to interface. Arduinos have dedicated I2C-pins that are used by the Wire-Library. Like A4(SDA), A5(SCL) on a UNO or 20(SDA), 21(SCL) on a MEGA 2560. Look out for the I2C-pins of your board. Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing