-
Notifications
You must be signed in to change notification settings - Fork 0
/
bob.ino
54 lines (36 loc) · 1.64 KB
/
bob.ino
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
43
44
45
46
47
48
49
50
51
52
#include "MyServo.h"
#include "StateMachine.h"
#include "Animateur.h"
#include "param.h"
MyServo servoPiedGauche(PIN_PIED_GAUCHE, MIN_PIED_GAUCHE, MID_PIED_GAUCHE, MAX_PIED_GAUCHE);
MyServo servoPiedDroit(PIN_PIED_DROIT, MIN_PIED_DROIT, MID_PIED_DROIT, MAX_PIED_DROIT);
MyServo servoHancheGauche(PIN_HANCHE_GAUCHE, MIN_HANCHE_GAUCHE, MID_HANCHE_GAUCHE, MAX_HANCHE_GAUCHE);
MyServo servoHancheDroite(PIN_HANCHE_DROITE, MIN_HANCHE_DROIT, MID_HANCHE_DROIT, MAX_HANCHE_DROIT);
MyServo servos[NOMBRE_SERVO];
int t = 1/0;
Animateur animateur;
StateMachine stateMachine;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SETUP
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
// Setup servos
servoPiedGauche.setup();
servoPiedDroit.setup();
servoHancheGauche.setup();
servoHancheDroite.setup();
// Init du tableau de servos
servos[SERVO_PIED_GAUCHE] = servoPiedGauche;
servos[SERVO_PIED_DROIT] = servoPiedDroit;
servos[SERVO_HANCHE_GAUCHE] = servoHancheGauche;
servos[SERVO_HANCHE_DROITE] = servoHancheDroite;
animateur.setServos(servos);
stateMachine.setAnimateur(animateur);
stateMachine.setup();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LOOP
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void loop() {
stateMachine.run();
}