-
Notifications
You must be signed in to change notification settings - Fork 0
/
Danse3.cpp
43 lines (33 loc) · 1.22 KB
/
Danse3.cpp
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
#include "Danse3.h"
Danse3::Danse3() {
_numberOfSteps = NB_STEPS_3;
_danse[0][SERVO_PIED_GAUCHE] = {MID_PIED_GAUCHE, 0};
_danse[0][SERVO_PIED_DROIT] = {MID_PIED_DROIT, 0};
_danse[0][SERVO_HANCHE_GAUCHE] = {MAX_HANCHE_GAUCHE, 1000};
_danse[0][SERVO_HANCHE_DROITE] = {MAX_HANCHE_DROIT, 1000};
_danse[1][SERVO_PIED_GAUCHE] = {MID_PIED_GAUCHE, 0};
_danse[1][SERVO_PIED_DROIT] = {MID_PIED_DROIT, 0};
_danse[1][SERVO_HANCHE_GAUCHE] = {MIN_HANCHE_GAUCHE, 500};
_danse[1][SERVO_HANCHE_DROITE] = {MIN_HANCHE_DROIT, 500};
_danse[2][SERVO_PIED_GAUCHE] = {MID_PIED_GAUCHE, 0};
_danse[2][SERVO_PIED_DROIT] = {MID_PIED_DROIT, 0};
_danse[2][SERVO_HANCHE_GAUCHE] = {MAX_HANCHE_GAUCHE, 500};
_danse[2][SERVO_HANCHE_DROITE] = {MAX_HANCHE_DROIT, 500};
_danse[3][SERVO_PIED_GAUCHE] = {MID_PIED_GAUCHE, 0};
_danse[3][SERVO_PIED_DROIT] = {MID_PIED_DROIT, 0};
_danse[3][SERVO_HANCHE_GAUCHE] = {MID_HANCHE_GAUCHE, 1000};
_danse[3][SERVO_HANCHE_DROITE] = {MID_HANCHE_DROIT, 1000};
}
Step Danse3::getCurrentStep(byte servo) {
return _danse[_currentStep][servo];
}
boolean Danse3::nextStep() {
_currentStep++;
if(_currentStep >= _numberOfSteps) {
return false;
}
return true;
}
void Danse3::init() {
_currentStep = 0;
}