-
Notifications
You must be signed in to change notification settings - Fork 2
/
GamePiece.java
44 lines (38 loc) · 943 Bytes
/
GamePiece.java
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
class GamePiece
{
public DcMotor gamePieceMotor;
public Servo gamePieceDump;
gamePieceMotor = hardwareMap.DcMotor.get("gamePieceMotor");
gamePieceDump = hardwareMap.Servo.get("gamePieceDump");
public static final double SERVO_DOWN = 0; //needs value
public static final double SERVO_UP = 0; //needs value
public static final double MOTOR_SPEED = 1;
public static final double MOTOR_OFF = 0;
public GamePiece()
{
public boolean servoUp = true;
public boolean motorOn = true;
gamePieceDump.setServoPosition(SERVO_UP);
}
public void toggleGamePieceDump()
{
if(servoUp == false)
{
gamePieceDump.setServoPosition(SERVO_UP);
}
else if(servoUp == true)
{
gamePieceDump.setServoPosition(SERVO_DOWN);
}
}
public void toggleGamePieceMotor()
{
if(motorOn == false)
}
{
gamePieceMotor.setMotorPower(MOTOR_SPEED);
}
else if(motorOn == true)
{
gamePieceMotor.setMotorPower(MOTOR_OFF);
}