-
Notifications
You must be signed in to change notification settings - Fork 0
/
Braccio_Wave.ino
102 lines (79 loc) · 2.82 KB
/
Braccio_Wave.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <Braccio.h>
#include <Servo.h>
Servo base;
Servo shoulder;
Servo elbow;
Servo wrist_rot;
Servo wrist_ver;
Servo gripper;
void setup() {
//Initialization functions and set up the initial position for Braccio
//All the servo motors will be positioned in the "safety" position:
//Base (M1):90 degrees
//Shoulder (M2): 45 degrees
//Elbow (M3): 180 degrees
//Wrist vertical (M4): 180 degrees
//Wrist rotation (M5): 90 degrees
//gripper (M6): 10 degrees
Braccio.begin();
}
void loop() {
/*
Step Delay: a milliseconds delay between the movement of each servo. Allowed values from 10 to 30 msec.
M1=base degrees. Allowed values from 0 to 180 degrees
M2=shoulder degrees. Allowed values from 15 to 165 degrees
M3=elbow degrees. Allowed values from 0 to 180 degrees
M4=wrist vertical degrees. Allowed values from 0 to 180 degrees
M5=wrist rotation degrees. Allowed values from 0 to 180 degrees
M6=gripper degrees. Allowed values from 10 to 73 degrees. 10: the toungue is open, 73: the gripper is closed.
*/
//(step delay, M1, M2, M3, M4, M5, M6);
Braccio.ServoMovement(20, 0, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 0, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 45, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 45, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 90, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 90, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 135, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 135, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 180, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 180, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 135, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 135, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 90, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 90, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 45, 90, 90, 45, 180, 15);
//Wait 1 second
delay(1000);
Braccio.ServoMovement(20, 45, 90, 90, 135, 180, 15);
//Wait 1 second
delay(1000);
}