Skip to content

Commit 085edf2

Browse files
committed
Initial commit, proof of concept prototype
0 parents  commit 085edf2

File tree

13 files changed

+1549856
-0
lines changed

13 files changed

+1549856
-0
lines changed

LICENSE

Lines changed: 675 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Bucky

code/Bucky.ino

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
////////////////////////////////////////////////////
3+
// FIRST PROOF OF CONCEPT
4+
////////////////////////////////////////////////////
5+
6+
#include <Servo.h>
7+
#include "bucky.h"
8+
9+
#define SEVO_PIN_1 9
10+
#define SEVO_PIN_2 10
11+
#define SEVO_PIN_3 11
12+
#define N_SERVOS 3
13+
14+
Servo Servo[N_SERVOS];
15+
16+
class Bucky {
17+
public:
18+
void jump (int t) {
19+
Servo[0].write(high_lim);
20+
Servo[1].write(high_lim);
21+
Servo[2].write(high_lim);
22+
delay(100);
23+
24+
Servo[0].write(low_lim);
25+
Servo[1].write(low_lim);
26+
Servo[2].write(low_lim);
27+
delay(t);
28+
}
29+
void flex(int t) {
30+
for (int i = low_lim; i < high_lim; i++) {
31+
Servo[0].write(i);
32+
Servo[1].write(i);
33+
Servo[2].write(i);
34+
delay(t);
35+
}
36+
for (int i = high_lim; i >= low_lim; i--) {
37+
Servo[0].write(i);
38+
Servo[1].write(i);
39+
Servo[2].write(i);
40+
delay(t);
41+
}
42+
}
43+
44+
private:
45+
const int low_lim = 110;
46+
const int high_lim = 179;
47+
};
48+
49+
Bucky bucky;
50+
51+
void setup()
52+
{
53+
Serial.begin(9600);
54+
55+
Servo[0].attach(SEVO_PIN_1);
56+
Servo[1].attach(SEVO_PIN_2);
57+
Servo[2].attach(SEVO_PIN_3);
58+
}
59+
60+
void loop()
61+
{
62+
bucky.jump(1000);
63+
}

0 commit comments

Comments
 (0)