-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodes.txt
81 lines (69 loc) · 1.75 KB
/
codes.txt
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package org.usfirst.frc.team6459.robot;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Talon;
public class Robot extends SampleRobot {
Talon kolcuk = new Talon(4);
Talon sagrampa = new Talon(5);
int autoLoopCounter;
RobotDrive AArobot;
Joystick solStick;
Joystick sagStick;
/*
* Robot
* Isim atamalari
*/
public Robot() {
AArobot = new RobotDrive(0,1,2,3);
solStick = new Joystick(0);
sagStick = new Joystick(1);
AArobot.stopMotor();
kolcuk.stopMotor();
sagrampa.stopMotor();
}
/*
* TeleOperated
* Tank drive ve tus atamalari
*/
public void operatorControl() {
AArobot.setSafetyEnabled(true);
kolcuk.setSafetyEnabled(true);
kolcuk.set(0.5);
sagrampa.setSafetyEnabled(true);
while (isOperatorControl() && isEnabled()) {
AArobot.tankDrive(solStick, sagStick);
/*
* Simit kolunun kalkis ve inis tus atamalari
*/
if (sagStick.getRawButton(1)) {
kolcuk.set(0.4);
}
else if (solStick.getRawButton(1)) {
kolcuk.set(-0.3);
kolcuk.stopMotor();
} else {
}
/*
* Sag rampanin milini kontrol eden motor
*/
if (solStick.getRawButton(3)) {
sagrampa.set(1);
}
else if (solStick.getRawButton(5)) {
sagrampa.set(-1);
} else {
sagrampa.set(0.0);
}
/*
* Nitro
*/
if (solStick.getRawButton(2)) {
AArobot.setMaxOutput(1);
}
else {
AArobot.setMaxOutput(0.5);
}
}
}
}