Performance Task 3

Warning

Looking for the raw code or download? See the GitHub repository.

This is the code for the performance task 3. The goal was to move from the starting position, go up the ramp, and flip the burger. For the bonus task, the goal was to flip any lever down.

Code

 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
// to center of ramp
PIMoveTo("start1.txt", 31, true);

//up ramp
PIMoveTo("mR34.txt", 31, false);

//east to wall
forward12(-25, 17);

//west off wall
//forward12(25, 1.5);
forward12(25, .75);

//rotate towards burger
rotateCC(25, 22);
//PIMoveTo("ss.txt", 6, false);

arm_servo.SetDegree(0);

//north towards burger
forward31(25, 8.1);
// back off from burger
forward31(-25, .15);
arm_servo.SetDegree(55);
Sleep(1.5);
arm_servo.SetDegree(0);
Sleep(1.5);

//south from burger
forward31(-25, 4);

//face ice cream
rotateCC(-25, 23);

arm_servo.SetDegree(70);

//move diagonally to lever
PIMoveTo("toLever.txt", 31, false);

arm_servo.SetDegree(40);
Sleep(1.5);
arm_servo.SetDegree(70);