From d3b283c69e9cf5ac6fe18c25be77a9b0488b9454 Mon Sep 17 00:00:00 2001 From: EnricoGuccii Date: Fri, 29 May 2026 23:34:00 +0200 Subject: new file structure, and buzzer removed --- firmware/lib/oled/oled.cpp | 58 ---------------------------------------------- firmware/lib/oled/oled.h | 18 -------------- 2 files changed, 76 deletions(-) delete mode 100644 firmware/lib/oled/oled.cpp delete mode 100644 firmware/lib/oled/oled.h (limited to 'firmware/lib/oled') diff --git a/firmware/lib/oled/oled.cpp b/firmware/lib/oled/oled.cpp deleted file mode 100644 index 2054b8f..0000000 --- a/firmware/lib/oled/oled.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include -#include "settings.h" -#include "oled.h" - -OLED::OLED() - : display(OLED_WIDTH, OLED_HEIGHT, &Wire, -1) {} - -void OLED::init() -{ - Wire.begin(SDA_PIN, SCL_PIN); - display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); - display.clearDisplay(); - display.setTextSize(1); - display.setTextColor(SSD1306_WHITE); -} - -void OLED::showMessage(const String &msg, int size, int x, int y) -{ - display.clearDisplay(); - display.setCursor(x, y); - display.setTextSize(size); - display.setTextColor(SSD1306_WHITE); - display.println(msg); - display.display(); -} - -void OLED::drawFullBitmap(const uint8_t *bitmap) -{ - display.clearDisplay(); - display.drawBitmap(0, 0, bitmap, OLED_WIDTH, OLED_HEIGHT, SSD1306_WHITE); - display.display(); -} - -void OLED::showAnimation(const byte *frames, int frameCount, int frameWidth, int frameHeight, int frameDelay) -{ - int x = 64 - (frameWidth / 2); - int y = 32 - (frameHeight / 2); - - for (int i = 0; i < frameCount; i++) - { - display.clearDisplay(); - display.drawBitmap( - x, y, - frames + i * (frameWidth * frameHeight / 8), - frameWidth, frameHeight, 1); - display.display(); - delay(frameDelay); - } -} - -void OLED::clear() -{ - display.clearDisplay(); - display.display(); -} diff --git a/firmware/lib/oled/oled.h b/firmware/lib/oled/oled.h deleted file mode 100644 index 2d5ff14..0000000 --- a/firmware/lib/oled/oled.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#include -#include "settings.h" - - -class OLED { -public: - OLED(); - - void init(); - void showMessage(const String& msg,int size = 1 ,int x = 0, int y = 0); - void drawFullBitmap(const uint8_t* bitmap); - void showAnimation(const byte* frames, int frameCount, int frameWidth, int frameHeight, int frameDelay); - void clear(); - -private: - Adafruit_SSD1306 display; -}; -- cgit v1.2.3