-
Notifications
You must be signed in to change notification settings - Fork 0
/
O-Back.c
executable file
·47 lines (40 loc) · 1.72 KB
/
O-Back.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
#pragma config(Hubs, S1, HTServo, HTMotor, HTMotor, HTMotor)
#pragma config(Sensor, S2, HTIRS2, sensorI2CCustom)
#pragma config(Sensor, S3, HTGYRO, sensorAnalogInactive)
#pragma config(Sensor, S4, SONAR, sensorSONAR)
#pragma config(Motor, motorA, green, tmotorNormal, openLoop)
#pragma config(Motor, motorB, yellow, tmotorNormal, openLoop)
#pragma config(Motor, motorC, red, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C2_1, ballArm, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C2_2, clawArm, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C3_1, intake, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C3_2, spool, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C4_1, right, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C4_2, left, tmotorNormal, openLoop, encoder)
#pragma config(Servo, srvo_S1_C1_1, clawRelease, tServoStandard)
#pragma config(Servo, srvo_S1_C1_2, armRelease, tServoStandard)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/* $Id$ */
#define GYRO
#define MOVE_GYRO
#define MOVE_TIMED
#include "Autonomous.h"
/**
* Starting on the outside, drive to the back parking area.
*/
task main()
{
initializeRobot();
// Wait for the beginning of autonomous phase.
waitForStart();
StartTask(prettyLights);
// go to the back parking area
if(useGyro)
{
moveGyro(MOTOR_FULL, MOVE_TO_BACK_TIME);
}
else
{
moveTimed(MOTOR_FULL, MOVE_TO_BACK_TIME);
}
}