-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ramp_left
67 lines (54 loc) · 2.16 KB
/
Ramp_left
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
57
58
59
60
61
62
63
64
65
66
67
#pragma config(Hubs, S1, HTMotor, HTMotor, none, none)
#pragma config(Hubs, S3, HTServo, none, none, none)
#pragma config(Hubs, S4, HTMotor, HTMotor, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Sensor, S2, INF, sensorHiTechnicIRSeeker1200)
#pragma config(Sensor, S3, , sensorI2CMuxController)
#pragma config(Sensor, S4, , sensorI2CMuxController)
#pragma config(Motor, mtr_S1_C1_1, red, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C1_2, yellow, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_1, green, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_2, blue, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C1_1, arm, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C1_2, whisk, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_1, lift, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_2, flag, tmotorTetrix, openLoop)
#pragma config(Servo, srvo_S3_C1_1, autoflipper, tServoStandard)
#pragma config(Servo, srvo_S3_C1_2, wrist, tServoStandard)
#pragma config(Servo, srvo_S3_C1_3, servo3, tServoNone)
#pragma config(Servo, srvo_S3_C1_4, servo4, tServoNone)
#pragma config(Servo, srvo_S3_C1_5, servo5, tServoNone)
#pragma config(Servo, srvo_S3_C1_6, servo6, tServoNone)
#include "JoystickDriver.c"
//oriented on flag turner
//ramp_left.c
task main()
{
//auto block facing out
servo[wrist] = 0;
servo[autoflipper] = 250;
waitForStart();
//robot go forwards
motor[red] = 60;
motor[yellow] = -60;
motor[green] = 60;
motor[blue] = -60;
wait10Msec(150);
//turn
motor[red] = -60;
motor[yellow] = -60;
motor[green] = -60;
motor[blue] = -60;
wait10Msec(30);
//go onto ramp
motor[red] = 100;
motor[yellow] = -100;
motor[green] = 100;
motor[blue] = -100;
wait10Msec(150);
//all stop
motor[red] = 0;
motor[yellow] = 0;
motor[green] = 0;
motor[blue] = 0;
}