-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVictory.c
executable file
·49 lines (46 loc) · 1.76 KB
/
Victory.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
#pragma config(Hubs, S1, HTMotor, none, none, none)
#pragma config(Hubs, S2, HTMotor, HTMotor, HTServo, none)
#pragma config(Sensor, S3, sound, sensorSoundDB)
#pragma config(Motor, mtr_S1_C1_1, motorWest, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, motorNorth, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S2_C1_1, motorEast, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S2_C1_2, motorSouth, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S2_C2_1, motorH, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S2_C2_2, motorI, tmotorNormal, openLoop)
#pragma config(Servo, srvo_S2_C3_1, flag, tServoStandard)
#pragma config(Servo, srvo_S2_C3_2, servo2, tServoNone)
#pragma config(Servo, srvo_S2_C3_3, servo3, tServoNone)
#pragma config(Servo, srvo_S2_C3_4, servo4, tServoNone)
#pragma config(Servo, srvo_S2_C3_5, servo5, tServoNone)
#pragma config(Servo, srvo_S2_C3_6, servo6, tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
bool flipped = false;
int mid = 128;
int diff = 30;
bool victoryRunning = false;
void pt(float freq, int time)
{
PlayTone(freq, time);
wait10Msec(time);
wait1Msec(10);/*
if (flipped)
servo[flag] = mid - diff;
else
servo[flag] = mid + diff;
flipped = !flipped;*/
}
task victory()
{
victoryRunning = true;
//servo[flag] = mid;
pt(587.33,10); // D
pt(587.33,10);
pt(587.33,10);
pt(587.33,30);
pt(466.16,30);
pt(523.25,30);
pt(587.33,20);
pt(523.25,10);
pt(587.33,100);
victoryRunning = false;
}