mirror of
https://github.com/DashyFox/MusicRing.git
synced 2025-05-04 13:30:16 +00:00
27 lines
737 B
C++
27 lines
737 B
C++
#pragma once
|
|
#include "../modules/Display.h"
|
|
|
|
#include <Adafruit_SSD1306.h>
|
|
|
|
class Display_Adafruit_SSD1306 : public Display {
|
|
public:
|
|
Adafruit_SSD1306* adafruit;
|
|
Display_Adafruit_SSD1306(uint16_t width, uint16_t height, uint16_t orientation) : Display(width, height, orientation) {
|
|
adafruit = new Adafruit_SSD1306(width, height, &Wire, -1);
|
|
};
|
|
|
|
void begin() { //TODO: Добавить поддержку других режимов
|
|
adafruit->begin(SSD1306_SWITCHCAPVCC, 0x3C);
|
|
adafruit->clearDisplay();
|
|
}
|
|
|
|
|
|
void writePixel(uint16_t x, uint16_t y, bool color) override {
|
|
adafruit->writePixel(x, y, color);
|
|
}
|
|
|
|
~Display_Adafruit_SSD1306() {
|
|
delete adafruit;
|
|
}
|
|
};
|