#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define oled_RESET 4
Adafruit_SSD1306 display(SCREEN_WIDTH,SCREEN_HEIGHT, &Wire, oled_RESET);
const int cw = SSD1306_WHITE;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c)){
Serial.print("ERROR");
while(1);
}
}
void loop() {
// put your main code here, to run repeatedly:
int mil = millis()/1000;
int pct = 5;
while(mil < 5){
display.clearDisplay();
display.setCursor(0,0);
display.setTextSize(2);
display.setTextColor(cw);
display.println(pct);
pct--;
display.display();
delay(1000);
}
}