-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathticktest.cpp
More file actions
71 lines (50 loc) · 1.12 KB
/
ticktest.cpp
File metadata and controls
71 lines (50 loc) · 1.12 KB
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
#include <iostream>
#include "motion.cpp"
#include "servo.cpp"
int running=1;
void sig_handler(int signo)
{
if (signo == SIGINT) {
printf("closing PWM nicely\n");
running = 0;
}
};
int main()
{
signal(SIGINT, sig_handler);
/*
Motor* base = new Motor(10,11,6,false); //base motor -counterclockwise when forward
Motor* lift = new Motor(8,9,3,false); //lift motor
Motor* left = new Motor(0,2,4,false);
Motor* right = new Motor(4,6,2,true);
Odometry* odo = new Odometry(left, right, 0, 0, 0);
Location* location = new Location(0.0,0.0,0.0);
Motion* motion = new Motion(left,right,odo,location);
//motion->straight(12);
//while(running&&!motion->run() ) usleep(10000);
//left->stop();
//right->stop();
//sleep(1);
Servo claw(15);
claw.write(0.7);
lift->forward();
lift->turnAngle(1930,3);
claw.write(0.15);
sleep(1);
lift->backward();
lift->turnAngle(1930,3);
sleep(1);
base->forward();
base->turnAngle(90,3);
sleep(1);
lift->forward();
lift->turnAngle(100,3);
claw.write(0.7);
sleep(1);
lift->backward();
lift->turnAngle(100,3);
claw.release();
sleep(1);
*/
return 0;
}