Skip to content

Commit e22ec6a

Browse files
authored
Added comments for pins used on different boards
To help users getting started less painful. You find 1000 pics of arduino UNOs connected at pins A4, A5 to the display but it doesn't work on your MEGA 2560 because there it's the pins 20, 21 that are used for I2C. You don't necessarily know that already at the moment you start with these displays. And you maybe do not search in the Wire-library for the solution.
1 parent 298a674 commit e22ec6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
2828

2929
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
30+
// The pins for I2C are defined by the Wire-library.
31+
// On an arduino UNO: A4(SDA), A5(SCL)
32+
// On an arduino MEGA 2560: 20(SDA), 21(SCL)
33+
// On an arduino LEONARDO: 2(SDA), 3(SCL), ...
3034
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
3135
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
3236

0 commit comments

Comments
 (0)