2026-10-13 00:56:32 +02:00
|
|
|
#include "display/frames.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
#include "display/bitmaps.h"
|
2026-10-13 01:34:04 +02:00
|
|
|
#include "display/text.h"
|
2026-10-13 00:56:32 +02:00
|
|
|
#include "logic/schedule.h"
|
|
|
|
|
|
|
|
|
|
// Horizontal offset that centers the 81 pixel wide clock on the 84 pixel display
|
|
|
|
|
static const int CLOCK_X = 3;
|
|
|
|
|
|
|
|
|
|
FlipdotFrames::FlipdotFrames(BROSE9323 &display) : _display(display)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FlipdotFrames::clock(int hour, int minute)
|
|
|
|
|
{
|
|
|
|
|
char time[6];
|
|
|
|
|
snprintf(time, sizeof(time), "%02d:%02d", hour, minute);
|
|
|
|
|
|
|
|
|
|
_display.fillScreen(0);
|
|
|
|
|
if (isEvening(hour))
|
|
|
|
|
_display.drawBitmap(CLOCK_X, 0, yawning_pikachu_bitmap_yawning_pikachu_black_border, 35, 19, 1);
|
|
|
|
|
else
|
|
|
|
|
_display.drawBitmap(CLOCK_X, 0, pikachu_bitmap_pikachu_black_border, 35, 19, 1);
|
|
|
|
|
_display.drawBitmap(CLOCK_X + 35, 0, clock_thought_bubble_bitmap_clock_thought_bubble, 46, 19, 1);
|
|
|
|
|
|
|
|
|
|
_display.setTextSize(1);
|
|
|
|
|
_display.setTextWrap(false);
|
|
|
|
|
_display.setCursor(CLOCK_X + 43, 4);
|
|
|
|
|
_display.print(time);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 01:34:04 +02:00
|
|
|
void FlipdotFrames::noWifi(int hour, int minute)
|
|
|
|
|
{
|
|
|
|
|
char time[6];
|
|
|
|
|
snprintf(time, sizeof(time), "%02d:%02d", hour, minute);
|
|
|
|
|
drawTextLines(_display, "No WiFi", time);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 00:56:32 +02:00
|
|
|
void FlipdotFrames::logo()
|
|
|
|
|
{
|
|
|
|
|
_display.fillScreen(0);
|
|
|
|
|
_display.drawBitmap(0, 0, nintendo_bitmap_Nintendo_new, 84, 19, 1);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FlipdotFrames::blank()
|
|
|
|
|
{
|
|
|
|
|
_display.fillScreen(0);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|