This repository was archived by the owner on Feb 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrvrOnlyWaterTower_AndAutonParking.js
More file actions
87 lines (57 loc) · 1.53 KB
/
rvrOnlyWaterTower_AndAutonParking.js
File metadata and controls
87 lines (57 loc) · 1.53 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
var lengthToWater =190;
var n = 0;
var distanceUpFirstRamp = 480;
var distanceToFire = 520;
async function startProgram() {
//await speak("Blue",false);
await driveToDistance(0,255,distanceUpFirstRamp);
stopRoll();
//await roll(0,50,1.75);
await delay(1);
setHeading(270);
await driveToDistance(270, 200, lengthToWater);
stopRoll();
//water tower knocking
await driveToDistance(0, -70, 66);
while (n<12){
await driveToDistance(0, 200,25);
await driveToDistance(0,-70,40);
n++;
}
await driveToDistance(0,100,66);
await driveToDistance(270,200,lengthToWater);
setHeading(185);
await delay(2);
resetAim();
//rolling down hill to other side
/*await driveToDistance(0,100, 685);
await driveToDistance(0,100,630);
await driveToDistance(270, 80, lengthToWater);
stopRoll();
//water tower knocking
await driveToDistance(0, -70, 66);
while (n<12){
await driveToDistance(0, 150,25);
await driveToDistance(0,-70,40);
n++;
}
await driveToDistance(0,25,66);
await driveToDistance(270,50,lengthToWater);
*/
//Autonomous Parking
await driveToDistance(0,80,distanceToFire);
await driveToDistance(270,80,188);
/*
await delay(4);
//VICTORY DANCE WOHOOOOOO
for(let degIndex =0;degIndex<100000;degIndex++){
var r = Math.random() * (255);
var g = Math.random() * (255);
var b = Math.random() * (255);
//await speak(r + " " + g + " " + b + " ", true);
setMainLed({ r: r, g: g, b: b });
await rawMotor(-100,100,0.01);
//await delay(0.1);
await delay(0.025);
*/
}