1
+ /* *************************************************************************************
2
+ * INCLUDE
3
+ **************************************************************************************/
4
+
1
5
#include < Braccio++.h>
2
6
3
- // Colors
7
+ /* *************************************************************************************
8
+ * DEFINE
9
+ **************************************************************************************/
10
+
4
11
#define COLOR_TEAL 0x00878F
5
12
#define COLOR_LIGHT_TEAL 0x62AEB2
6
13
#define COLOR_ORANGE 0xE47128
7
14
8
- // ENTER button
9
15
#define BUTTON_ENTER 6
10
16
17
+ /* *************************************************************************************
18
+ * TYPEDEF
19
+ **************************************************************************************/
20
+
11
21
enum class State
12
22
{
13
23
RECORD,
14
24
REPLAY,
15
25
ZERO_POSITION
16
26
};
17
27
28
+ /* *************************************************************************************
29
+ * GLOBAL VARIABLES
30
+ **************************************************************************************/
31
+
18
32
State state = State::ZERO_POSITION;
19
33
20
34
static int const MAX_SAMPLES = 6 *100 *2 ; /* 20 seconds. */
@@ -29,6 +43,9 @@ static lv_obj_t * btnm;
29
43
30
44
static const char * btnm_map[] = { " RECORD" , " \n " , " REPLAY" , " \n " , " ZERO_POSITION" , " \n " , " \0 " };
31
45
46
+ /* *************************************************************************************
47
+ * FUNCTIONS
48
+ **************************************************************************************/
32
49
33
50
static void eventHandlerMenu (lv_event_t * e)
34
51
{
@@ -135,6 +152,10 @@ void mainMenu()
135
152
Braccio.connectJoystickTo (btnm);
136
153
}
137
154
155
+ /* *************************************************************************************
156
+ * SETUP/LOOP
157
+ **************************************************************************************/
158
+
138
159
void setup () {
139
160
Braccio.begin (mainMenu);
140
161
delay (500 );
0 commit comments