Public Access
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#include "display/frames.h"
|
|||
|
|
|
||
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
#include "display/bitmaps.h"
|
||
|
|
#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();
|
||
|
|
}
|
||
|
|
|
||
|
|
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();
|
||
|
|
}
|
||
|
|
|
||
|
|
void FlipdotFrames::message(const char *text)
|
||
|
|
{
|
||
|
|
_display.fillScreen(0);
|
||
|
|
_display.setTextSize(1);
|
||
|
|
_display.setTextWrap(true);
|
||
|
|
_display.setCursor(0, 0);
|
||
|
|
_display.print(text);
|
||
|
|
_display.display();
|
||
|
|
}
|