This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
speedclock/tests/OLED_TEST/OLED_TEST.ino

28 lines
635 B
Arduino
Raw Permalink Normal View History

2018-07-07 16:19:49 +02:00
// Test for minimum program size.
#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
// 0X3C+SA0 - 0x3C or 0x3D
#define I2C_ADDRESS 0x3C
2018-07-07 19:17:51 +02:00
SSD1306AsciiWire display;
2018-07-07 16:19:49 +02:00
//------------------------------------------------------------------------------
void setup() {
Wire.begin();
Wire.setClock(400000L);
2018-07-07 19:17:51 +02:00
display.begin(&Adafruit128x64, I2C_ADDRESS);
2018-07-07 16:19:49 +02:00
2018-07-07 19:17:51 +02:00
display.setFont(System5x7);
display.clear();
display.print("Hello world!");
2018-07-07 16:19:49 +02:00
}
//------------------------------------------------------------------------------
void loop() {
2018-07-07 19:17:51 +02:00
display.setCursor(60, 4);
display.set2X();
display.println(millis());
2018-07-07 16:19:49 +02:00
}