@@ -80,15 +80,6 @@ void moveJoints(uint32_t btnID) {
80
80
}
81
81
82
82
// Event Handlers
83
- static void eventHandlerMenu (lv_event_t * e) {
84
- lv_obj_t * obj = lv_event_get_target (e);
85
- uint32_t id = lv_btnmatrix_get_selected_btn (obj);
86
-
87
- selectedJoints = jointsPair[id];
88
-
89
- directionScreen ();
90
- lv_obj_del (btnm);
91
- }
92
83
93
84
static void eventHandlerDirectional (lv_event_t * e) {
94
85
lv_event_code_t code = lv_event_get_code (e);
@@ -141,8 +132,6 @@ void mainMenu() {
141
132
lv_btnmatrix_set_one_checked (btnm, true );
142
133
lv_btnmatrix_set_selected_btn (btnm, 0 );
143
134
144
- lv_obj_add_event_cb (btnm, eventHandlerMenu, LV_EVENT_PRESSED, NULL );
145
-
146
135
Braccio.connectJoystickTo (btnm);
147
136
}
148
137
@@ -175,7 +164,7 @@ void directionScreen(void)
175
164
lv_btnmatrix_set_btn_ctrl (directional, 7 , LV_BTNMATRIX_CTRL_CHECKABLE);
176
165
lv_btnmatrix_set_btn_ctrl (directional, 8 , LV_BTNMATRIX_CTRL_HIDDEN);
177
166
178
- if (selectedJoints == " Elbow " ) {
167
+ if (state == ELBOW ) {
179
168
lv_btnmatrix_set_btn_ctrl (directional, 3 , LV_BTNMATRIX_CTRL_HIDDEN);
180
169
lv_btnmatrix_set_btn_ctrl (directional, 5 , LV_BTNMATRIX_CTRL_HIDDEN);
181
170
}
@@ -185,12 +174,12 @@ void directionScreen(void)
185
174
186
175
lv_obj_add_event_cb (directional, eventHandlerDirectional, LV_EVENT_ALL, NULL );
187
176
188
- delay (50 );
189
- Braccio.connectJoystickTo (btnm );
177
+ // delay(50);
178
+ Braccio.connectJoystickTo (directional );
190
179
}
191
180
192
181
void setup () {
193
- Braccio.begin (mainMenu );
182
+ Braccio.begin (directionScreen );
194
183
delay (500 ); // Waits for the Braccio initialization
195
184
196
185
Braccio.speed (SLOW);
0 commit comments