This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.c
56 lines (49 loc) · 1.75 KB
/
tests.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
#pragma config(Sensor, in1, lfLeft, sensorLineFollower)
#pragma config(Sensor, in5, lfMid, sensorLineFollower)
#pragma config(Sensor, in8, lfRight, sensorLineFollower)
#pragma config(Sensor, dgtl1, stopBump, sensorTouch)
#pragma config(Sensor, dgtl2, bottomLimit, sensorTouch)
#pragma config(Sensor, dgtl7, warningLED1, sensorLEDtoVCC)
#pragma config(Sensor, dgtl8, warningLED2, sensorLEDtoVCC)
#pragma config(Sensor, dgtl9, stopLED1, sensorLEDtoVCC)
#pragma config(Sensor, dgtl10, stopLED2, sensorLEDtoVCC)
#pragma config(Sensor, dgtl11, runningLED1, sensorLEDtoVCC)
#pragma config(Sensor, dgtl12, runningLED2, sensorLEDtoVCC)
#pragma config(Motor, port1, flashlightLeft, tmotorVexFlashlight, openLoop, reversed)
#pragma config(Motor, port2, beltLeft, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, paddleLeft, tmotorServoStandard, openLoop)
#pragma config(Motor, port8, paddleRight, tmotorServoStandard, openLoop)
#pragma config(Motor, port9, beltRight, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, flashlightRight, tmotorVexFlashlight, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "constants.c"
#include "basic-control.c"
#include "behaviors.c"
task haltDetection() {
while (true) {
if (SensorValue[stopBump] == 1) {
warningOn(true);
runningOn(false);
stopAllTasks();
}
}
}
task main()
{
/* while(true){ // jam
wait1Msec(2000);
}*/
startTask(haltDetection);
runningOn(true);
stopOn(false);
while(true) {
reset();
elevator();
reset();
paddle(GREEN);
}
while(true) {
stopOn(true);
runningOn(false);
}
}