#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "Led.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Led rled(&display, 34, (SCREEN_HEIGHT / 2),'R', 2000, 2000);
Led gled2(&display, 68, (SCREEN_HEIGHT / 2),'G', 1500, 500);
Led bled3(&display, 102, (SCREEN_HEIGHT / 2),'B', 200, 800);
void setup()
{
Serial.begin(9600);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.setTextSize(1);
display.setTextColor(WHITE);
rled.init();
gled2.init();
bled3.init();
display.display();
}
void loop()
{
unsigned long curr_time = millis();
rled.handle(curr_time);
gled2.handle(curr_time);
bled3.handle(curr_time);
// The Led Class Method only manipulates display memory
display.display();
}