-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestStraightness.c
91 lines (70 loc) · 1.64 KB
/
testStraightness.c
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
#pragma config(Sensor, dgtl5, quad, sensorQuadEncoder)
#pragma config(Motor, port3, m, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(DatalogSeries, 0, "", Sensors, Sensor, dgtl5, 1000)
#pragma config(DatalogSeries, 1, "", Timers, time1, T1, 1000)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
void clearLCD(){
clearLCDLine(0);
clearLCDLine(1);
}
void resetEncoders(){
SensorValue[ quad ] = 0;
}
string mainBattery;
string battery0;
string battery10;
//void lcd display voltage
void lcd(){
clearLCD();
//Display the Backup battery voltage
displayLCDString(1, 0, "Total Dist: ");
displayNextLCDNumber(SensorValue[quad]);
//Short delay for the LCD refresh rate
wait1Msec(100);
}
bool timerBool=true;
float zero=0.0;
float one=0.0;
float two=0.0;
float three=0.0;
float four=0.0;
float five=0.0;
float six=0.0;
float seven=0.0;
float eight=0.0;
float nine=0.0;
float ten=0.0;
task main(){
battery0=mainBattery;
resetEncoders();
while(timerBool){
motor[m]=127;
lcd();
while(timerBool){
zero=SensorValue[quad];
wait1Msec(1000);
one=SensorValue[quad];
wait1Msec(1000);
two=SensorValue[quad];
wait1Msec(1000);
three=SensorValue[quad];
wait1Msec(1000);
four=SensorValue[quad];
wait1Msec(1000);
five=SensorValue[quad];
wait1Msec(1000);
six=SensorValue[quad];
wait1Msec(1000);
seven=SensorValue[quad];
wait1Msec(1000);
eight=SensorValue[quad];
wait1Msec(1000);
nine=SensorValue[quad];
wait1Msec(1000);
ten=SensorValue[quad];
wait1Msec(1000);
battery10=mainBattery;
timerBool=false;
}
}
}