-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimations.h
52 lines (45 loc) · 1.71 KB
/
animations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <Arduino.h>
#include "display_handler.h"
#include "tasks.h"
#include "error_type.h"
struct Color {
uint8_t r;
uint8_t g;
uint8_t b;
Color(uint8_t red = 0, uint8_t green = 0, uint8_t blue = 0)
: r(red), g(green), b(blue) {}
};
class Animations {
public:
static const Color ERROR_RED;
static const Color ERROR_DOT_BLUE;
static const Color ERROR_DOT_YELLOW;
static const Color ERROR_DOT_PURPLE;
static const Color RECYCLING_GREEN;
static const Color RUBBISH_BROWN;
static const Color DEFAULT_BLUE;
static const Color SETUP_YELLOW;
static const Color LOADING_WHITE;
static const Color COMPLETE_GREEN;
static void drawError(DisplayHandler& display, ErrorType type);
static void drawPrepare(DisplayHandler& display);
static void drawLoading(DisplayHandler& display);
static void drawSetupMode(DisplayHandler& display);
static void drawPulse(DisplayHandler& display, Color color);
static void drawBinImage(DisplayHandler& display, Color color);
static void drawComplete(DisplayHandler& display, Color color);
private:
static const uint8_t exclamation[8][8];
static const uint8_t binImage[8][8];
static const uint8_t completeImage[8][8];
static int brightnessTick;
static int loadingPos;
static int animationCounter;
static const int ANIMATION_SPEED = 4;
static Color prepareColor;
static unsigned long lastPulseTime;
static uint8_t calculateBrightness();
static void updateLoadingPosition();
static void drawError(DisplayHandler& display, Color stroke, Color dot);
};