-
Notifications
You must be signed in to change notification settings - Fork 0
/
DD-3.ino
52 lines (42 loc) · 931 Bytes
/
DD-3.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 <Arduino.h>
#include "body_to_head.hpp"
#include "drive.hpp"
#include "eye.hpp"
#include "eyebrows.hpp"
#include "head_spin.hpp"
#include "head_tilt.hpp"
#include "joysticks.hpp"
#include "servoboard.hpp"
#include "switch.hpp"
void setup() {
switch_init();
head_spin_init();
servoboard_init();
drive_init();
joystick_init();
body_to_head_init();
Serial.begin(9600);
delay(10);
}
int eye_counter = 0;
int head_tilt_counter = 0;
int eyebrow_breath = 127;
bool flipped = false;
int add_value = 3;
_switch last_pos = DOWN;
void loop() {
switch_runtime();
joystick_runtime();
head_spin_runtime();
drive_runtime();
// eyebrows_runtime();
head_tilt_runtime();
_switch cur = joystick_channel(RIGHT_DUAL_SWTICH);
if (cur == UP && last_pos != cur) {
servoboard_sleep(true);
} else if (cur == DOWN && last_pos != cur) {
servoboard_sleep(false);
}
last_pos = cur;
delay(10);
}