-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUI.h
More file actions
47 lines (34 loc) · 990 Bytes
/
UI.h
File metadata and controls
47 lines (34 loc) · 990 Bytes
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
#ifndef UI_h
#define UI_h
#include <Arduino.h>
#include <Adafruit_GFX.h> // Core graphics library: https://github.com/adafruit/Adafruit-GFX-Library
#include <TouchScreen.h> // https://github.com/adafruit/Touch-Screen-Library
#include "Button.h"
#define NUM_BUTTONS 9
#define MANUAL_BUTTON 0
#define TIMER1_BUTTON 1
#define TIMER2_BUTTON 2
#define PLAY_BUTTON 3
#define REC_BUTTON 4
#define UP_BUTTON 5
#define DOWN_BUTTON 6
#define REC_BUTTON_ACTIVE 7
#define PAUSE_BUTTON 8
class UI {
public:
UI();
void init();
void refresh();
void showSplashScreen(String name, String version);
void updateContent(unsigned int newContent);
void checkButtonPressed();
void addButton(int btnId, void (*callback)());
void activateButton(int btnId);
private:
int _activeButtonId;
unsigned int _content;
Button _buttons[NUM_BUTTONS];
Adafruit_GFX *_gfx;
TouchScreen *_touchScreen;
};
#endif