1+ /* *************************************************************************************
2+ * INCLUDE
3+ **************************************************************************************/
4+
15#include < Braccio++.h>
26
3- // Colors
7+ /* *************************************************************************************
8+ * DEFINE
9+ **************************************************************************************/
10+
411#define COLOR_TEAL 0x00878F
512#define COLOR_LIGHT_TEAL 0x62AEB2
613#define COLOR_ORANGE 0xE47128
714
8- // ENTER button
915#define BUTTON_ENTER 6
1016
17+ /* *************************************************************************************
18+ * TYPEDEF
19+ **************************************************************************************/
20+
1121enum class State
1222{
1323 RECORD,
1424 REPLAY,
1525 ZERO_POSITION
1626};
1727
28+ /* *************************************************************************************
29+ * GLOBAL VARIABLES
30+ **************************************************************************************/
31+
1832State state = State::ZERO_POSITION;
1933
2034static int const MAX_SAMPLES = 6 *100 *2 ; /* 20 seconds. */
@@ -29,6 +43,9 @@ static lv_obj_t * btnm;
2943
3044static const char * btnm_map[] = { " RECORD" , " \n " , " REPLAY" , " \n " , " ZERO_POSITION" , " \n " , " \0 " };
3145
46+ /* *************************************************************************************
47+ * FUNCTIONS
48+ **************************************************************************************/
3249
3350static void eventHandlerMenu (lv_event_t * e)
3451{
@@ -135,6 +152,10 @@ void mainMenu()
135152 Braccio.connectJoystickTo (btnm);
136153}
137154
155+ /* *************************************************************************************
156+ * SETUP/LOOP
157+ **************************************************************************************/
158+
138159void setup () {
139160 Braccio.begin (mainMenu);
140161 delay (500 );
0 commit comments