mirror of
https://github.com/adafruit/Adafruit_SSD1306.git
synced 2026-07-27 20:05:50 +00:00
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.
This commit is contained in:
@@ -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 defined by the Wire-library.
|
||||
// On an arduino UNO: A4(SDA), A5(SCL)
|
||||
// On an arduino MEGA 2560: 20(SDA), 21(SCL)
|
||||
// On an arduino LEONARDO: 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user