-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOLedExampleCode.ino
More file actions
41 lines (30 loc) · 792 Bytes
/
Copy pathOLedExampleCode.ino
File metadata and controls
41 lines (30 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);
int counter;
void setup() {
Serial.begin(1000);
Serial.println("OLED intialized");
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32
display.display();
delay(1000);
// Clear the buffer.
display.clearDisplay();
display.display();
// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
}
void loop() {
for (counter = 0 ; counter <= 25 ; counter++) {
display.clearDisplay();
display.setCursor(0, 0);
display.println("test counter");
display.print("counter: ");
display.println(counter);
display.display();
delay(1000);
}
}