Skip to content

Commit b346e4d

Browse files
committed
Ensure a mininum delay between two consecutive Braccio++ actions.
1 parent 6a54383 commit b346e4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/Braccio_Record_and_Replay/AppState.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void RecordState::onEnter()
148148
lv_btnmatrix_set_btn_ctrl(btnm, 1, LV_BTNMATRIX_CTRL_DISABLED);
149149
lv_btnmatrix_set_btn_ctrl(btnm, 2, LV_BTNMATRIX_CTRL_DISABLED);
150150

151+
delay(100);
151152
Braccio.disengage();
152153
delay(100);
153154
sample_cnt = 0;
@@ -161,7 +162,9 @@ void RecordState::onExit()
161162
lv_btnmatrix_clear_btn_ctrl(btnm, 2, LV_BTNMATRIX_CTRL_DISABLED);
162163
lv_label_set_text_fmt(counter, "Counter: %d" , 0);
163164

165+
delay(100);
164166
Braccio.engage();
167+
delay(100);
165168
}
166169

167170
State * RecordState::handle_OnRecord()
@@ -268,6 +271,7 @@ void ZeroState::onEnter()
268271
lv_btnmatrix_set_btn_ctrl(btnm, 1, LV_BTNMATRIX_CTRL_DISABLED);
269272
lv_btnmatrix_set_btn_ctrl(btnm, 2, LV_BTNMATRIX_CTRL_CHECKED);
270273

274+
delay(100);
271275
Braccio.engage();
272276
delay(100);
273277
Braccio.moveTo(HOME_POS[0], HOME_POS[1], HOME_POS[2], HOME_POS[3], HOME_POS[4], HOME_POS[5]);

0 commit comments

Comments
 (0)