-
Notifications
You must be signed in to change notification settings - Fork 0
/
A3_1_3_Part2.c
40 lines (33 loc) · 1.24 KB
/
A3_1_3_Part2.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
#pragma config(Sensor, dgtl1, limitSwitch, sensorTouch)
#pragma config(Sensor, dgtl2, bumpSwitch, sensorTouch)
#pragma config(Sensor, dgtl3, quad, sensorQuadEncoder)
#pragma config(Sensor, dgtl5, sonar, sensorSONAR_inch)
#pragma config(Sensor, dgtl12, green, sensorLEDtoVCC)
#pragma config(Motor, port1, flashlight, tmotorVexFlashlight, openLoop, reversed)
#pragma config(Motor, port2, rightMotor, tmotorVex269, openLoop)
#pragma config(Motor, port3, leftMotor, tmotorVex269, openLoop)
#pragma config(Motor, port9, servoMotor, tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*
Project Title:
Team Members: Patrick Kubiak
Date:
Section:
Task Description:
Pseudocode:
*/
task main()
{ //Program begins, insert code within curly braces
while (true)
{
untilBump(bumpSwitch); //after bump switch is pressed and released
startMotor(rightMotor, 127/2);
startMotor(leftMotor, 127/2);
untilBump(bumpSwitch);
startMotor(rightMotor, -127/2);
startMotor(leftMotor, -127/2);
wait(3.5);
stopMotor(rightMotor);
stopMotor(leftMotor);
}
}