Here is how to get the display running with Arduino. Download and install both these adafruit libraries:
https://github.com/adafruit/Adafruit_SSD1306
and:
https://github.com/adafruit/Adafruit-GFX-Library
Hint: use the ZIP button on the github page to get all the files.
For installation instructions see my previous post.
Open the example ssd1306_128x32_i2c in the Arduino software. When compiling you will probably get this error mesage "ssd1306_128x32_i2c.ino:53:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");"
To fix this open the newly installed library file: Adafruit_SSD1306.h
Find these lines in the file:
#define SSD1306_128_64
// #define SSD1306_128_32
change them to:
// #define SSD1306_128_64
#define SSD1306_128_32
Save the file and compile again. This time it should complete without errors.
Hint: Use CTRL+R to compile.
Connect your display to the Arduino UNO as follows:
- ⏚ to GND
- + to 5V
- SDA to A4
- SCL to A5
Upload the code to the Arduino and your display should wake up!
Hint: Use CTRL+U to Upload.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.