forked from StRobertCHSCS/ICS4U-PCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSorting
More file actions
34 lines (33 loc) · 1.16 KB
/
Sorting
File metadata and controls
34 lines (33 loc) · 1.16 KB
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
#pragma config(Sensor, port3, colour, sensorVexIQ_Color12Color)
#pragma config(Motor, motor1, left, tmotorVexIQ, PIDControl, driveLeft, encoder)
#pragma config(Motor, motor6, right, tmotorVexIQ, PIDControl, reversed, driveRight, encoder)
#pragma config(Motor, motor10, lift, tmotorVexIQ, PIDControl, encoder)
#pragma config(Motor, motor11, claw, tmotorVexIQ, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while (true)
{
setMultipleMotors(50, left, right);
while (getColorName(colour) == colorRed)
{
forward(180, degrees, 50);
moveMotor(claw, 90, degrees, 50);
turnLeft(275, degrees, 50);
forward(360, degrees, 50);
moveMotor(claw, 90, degrees, -50);
backward(360, degrees, -50);
turnRight(275, degrees, 50);
}
while (getColorName(colour) == colorGreen)
{
forward(180, degrees, 50);
moveMotor(claw, 90, degrees, 50);
turnRight(275, degrees, 50);
forward(360, degrees, 50);
moveMotor(claw, 90, degrees, -50);
backward(360, degrees, -50);
turnLeft(275, degrees, 50);
}
}
}