From 8961d7b24e989e2e1ad34f52b7f7a8d85859d47b Mon Sep 17 00:00:00 2001 From: CodeCrafter912 Date: Sat, 7 Jul 2018 16:19:49 +0200 Subject: [PATCH] updated to faster lib --- OLED_TEST/OLED_TEST.ino | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 OLED_TEST/OLED_TEST.ino diff --git a/OLED_TEST/OLED_TEST.ino b/OLED_TEST/OLED_TEST.ino new file mode 100644 index 0000000..91cd20c --- /dev/null +++ b/OLED_TEST/OLED_TEST.ino @@ -0,0 +1,33 @@ +// Test for minimum program size. + +#include +#include "SSD1306Ascii.h" +#include "SSD1306AsciiWire.h" + +// 0X3C+SA0 - 0x3C or 0x3D +#define I2C_ADDRESS 0x3C + +// Define proper RST_PIN if required. +#define RST_PIN -1 + +SSD1306AsciiWire oled; +//------------------------------------------------------------------------------ +void setup() { + Wire.begin(); + Wire.setClock(400000L); + +#if RST_PIN >= 0 + oled.begin(&Adafruit128x64, I2C_ADDRESS, RST_PIN); +#else // RST_PIN >= 0 + oled.begin(&Adafruit128x64, I2C_ADDRESS); +#endif // RST_PIN >= 0 + + oled.setFont(System5x7); + oled.clear(); + oled.print("Hello world!"); +} +//------------------------------------------------------------------------------ +void loop() { + oled.setCursor(60, 4); + oled.println(millis()); +}