forked from ftctechnh/ftc_app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ftctechnh#1 from GG7190/mergingLastYear
merging in last years code
- Loading branch information
Showing
11 changed files
with
860 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
FtcRobotController/src/main/java/com/qualcomm/ftcrobotcontroller/greengirls/Motor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.greengirls; | ||
|
||
/** | ||
* Created by G201956 on 9/23/2015. | ||
*/ | ||
public class Motor { | ||
private int power = 0; | ||
public int stopMotor() { | ||
power = 0; | ||
System.out.println ("hi"); | ||
return 0; | ||
} | ||
public void setPower(int motorPower){ | ||
power = motorPower; | ||
} | ||
public int getPower(){ | ||
return power; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...troller/src/main/java/com/qualcomm/ftcrobotcontroller/greengirls/ResQ2016/ResQTeleop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.greengirls.ResQ2016; | ||
|
||
import com.greengirls.ResQ2016.RobotHardware2016; | ||
|
||
/** | ||
* Created by Dell User on 10/25/2015. | ||
*/ | ||
public class ResQTeleop extends RobotHardware2016 { | ||
/* | ||
* Code to run when the op mode is initialized goes here | ||
* | ||
* @see com.qualcomm.robotcore.eventloop.opmode.OpMode#init() | ||
*/ | ||
|
||
|
||
@Override | ||
public void init() { | ||
|
||
super.init(); | ||
|
||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
.../src/main/java/com/qualcomm/ftcrobotcontroller/greengirls/ResQ2016/RobotHardware2016.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.greengirls.ResQ2016; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.OpMode; | ||
import com.qualcomm.robotcore.hardware.DcMotorController; | ||
import com.qualcomm.robotcore.hardware.IrSeekerSensor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.ServoController; | ||
/** | ||
* Created by Dell User on 10/25/2015. | ||
*/ | ||
public class RobotHardware2016 extends OpMode{ | ||
|
||
//define Motors and MotorControllers | ||
private DcMotorController rightMotorController; | ||
private DcMotor rightFrontMotor; | ||
private DcMotorController leftMotorController; | ||
private DcMotor leftFrontMotor; | ||
private DcMotor rightBackMotor; | ||
private DcMotor leftBackMotor; | ||
private DcMotorController attachmentMotorController; | ||
private DcMotor liftMotorRight; | ||
private DcMotor liftMotorLeft; | ||
|
||
@Override public void init() { | ||
|
||
|
||
//Map hardware for Right motor controller | ||
rightMotorController = hardwareMap.dcMotorController.get("right_drive_controller"); | ||
rightFrontMotor = hardwareMap.dcMotor.get("right_front_motor"); | ||
rightBackMotor = hardwareMap.dcMotor.get("right_back_motor"); | ||
|
||
//Map hardware for Left motor controller | ||
leftMotorController = hardwareMap.dcMotorController.get("left_drive_controller"); | ||
leftFrontMotor = hardwareMap.dcMotor.get("left_front_motor"); | ||
leftBackMotor = hardwareMap.dcMotor.get("left_back_motor"); | ||
|
||
//Map hardware for attachment motor controller | ||
attachmentMotorController = hardwareMap.dcMotorController.get("attachment_controller"); | ||
liftMotorRight = hardwareMap.dcMotor.get("lift_right_motor"); | ||
liftMotorLeft = hardwareMap.dcMotor.get("lift_left_motor"); | ||
|
||
} | ||
|
||
//get the power for both right motors | ||
public double getRightMotors(){ | ||
return rightFrontMotor.getPower(); | ||
} | ||
|
||
//set get power for both left motors | ||
public double getLeftMotors(){ | ||
return leftFrontMotor.getPower(); | ||
} | ||
|
||
//set power to right motors | ||
public void setRightMotors(double power){ | ||
rightFrontMotor.setPower(power); | ||
rightBackMotor.setPower(power); | ||
} | ||
|
||
//set power to left motors | ||
public void setLeftMotors(double power){ | ||
leftFrontMotor.setPower(power); | ||
leftBackMotor.setPower(power); | ||
} | ||
|
||
//get the power to right lift motor | ||
public double getLiftMotorRight(){ | ||
return liftMotorRight.getPower(); | ||
} | ||
|
||
//set the power to right lift motor | ||
public void setLiftMotorRight(double power) { | ||
liftMotorRight.setPower(power); | ||
} | ||
|
||
//get the power to left lift motor | ||
public double getLiftMotorLeft(){ | ||
return liftMotorLeft.getPower(); | ||
} | ||
|
||
//set the power to collector motor | ||
public void setLiftMotorLeft(double power) { | ||
liftMotorLeft.setPower(power); | ||
} | ||
|
||
@Override public void loop() { | ||
|
||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
FtcRobotController/src/main/java/com/qualcomm/ftcrobotcontroller/greengirls/Robot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.greengirls; | ||
|
||
/** | ||
* Represents the state of our Robot. | ||
* | ||
* @author The Green Girls | ||
* @since 9/20/2015. | ||
*/ | ||
public class Robot { | ||
private boolean isDeflectorUp = false; | ||
private int compassHeading = 0; | ||
private drivingMotor front; | ||
private drivingMotor rear; | ||
public static void main(String args[]) { | ||
Motor rightFront = new Motor(); | ||
rightFront.stopMotor(); | ||
} | ||
|
||
/** | ||
* Determines whether the deflector | ||
* is currently up | ||
* | ||
* @return {@code true} if the deflector is | ||
* up, {@code false} otherwise | ||
*/ | ||
public boolean isDeflectorUp(){ | ||
return isDeflectorUp; | ||
} | ||
|
||
/** | ||
* Sets the deflector state | ||
* | ||
* @param state {@code true} for up, | ||
* {@code false} for down. | ||
*/ | ||
public void setDeflectorUp(boolean state){ | ||
isDeflectorUp = state; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...ontroller/src/main/java/com/qualcomm/ftcrobotcontroller/greengirls/RobotHardware2016.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.greengirls; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.OpMode; | ||
import com.qualcomm.robotcore.hardware.DcMotorController; | ||
import com.qualcomm.robotcore.hardware.IrSeekerSensor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.ServoController; | ||
/** | ||
* Created by Dell User on 10/25/2015. | ||
*/ | ||
public class RobotHardware2016 extends OpMode{ | ||
|
||
//define Motors and MotorControllers | ||
private DcMotorController rightMotorController; | ||
private DcMotor rightFrontMotor; | ||
private DcMotorController leftMotorController; | ||
private DcMotor leftFrontMotor; | ||
private DcMotor rightBackMotor; | ||
private DcMotor leftBackMotor; | ||
private DcMotorController attachmentMotorController; | ||
private DcMotor liftMotor; | ||
|
||
@Override public void init() { | ||
|
||
|
||
//Map hardware for Right motor controller | ||
rightMotorController = hardwareMap.dcMotorController.get("right_drive_controller"); | ||
rightFrontMotor = hardwareMap.dcMotor.get("right_front_motor"); | ||
rightBackMotor = hardwareMap.dcMotor.get("right_back_motor"); | ||
|
||
//Map hardware for Left motor controller | ||
leftMotorController = hardwareMap.dcMotorController.get("left_drive_controller"); | ||
leftFrontMotor = hardwareMap.dcMotor.get("left_front_motor"); | ||
leftBackMotor = hardwareMap.dcMotor.get("left_back_motor"); | ||
|
||
//Map hardware for attachment motor controller | ||
attachmentMotorController = hardwareMap.dcMotorController.get("attachment_controller"); | ||
liftMotor = hardwareMap.dcMotor.get("lift_motor"); | ||
|
||
} | ||
|
||
@Override public void loop() { | ||
|
||
} | ||
} |
Oops, something went wrong.