This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
-
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.
- Loading branch information
Showing
1 changed file
with
14 additions
and
17 deletions.
There are no files selected for viewing
31 changes: 14 additions & 17 deletions
31
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt
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 |
---|---|---|
@@ -1,51 +1,48 @@ | ||
package org.firstinspires.ftc.teamcode.api | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.OpMode | ||
import com.qualcomm.robotcore.hardware.DcMotor | ||
import com.qualcomm.robotcore.hardware.Servo | ||
|
||
object Box : API() { | ||
|
||
private lateinit var boxL: Servo | ||
private lateinit var boxR: Servo | ||
private lateinit var grip: Servo | ||
|
||
override fun init(opMode : OpMode) { | ||
|
||
override fun init(opMode: OpMode) { | ||
super.init(opMode) | ||
|
||
this.boxL = this.hardwareMap.get(Servo::class.java, "boxL") | ||
this.boxR = this.hardwareMap.get(Servo::class.java, "boxR") | ||
this.grip = this.hardwareMap.get(Servo::class.java, "grip") | ||
} | ||
|
||
/* | ||
* Moves the box to the ground | ||
*/ | ||
/** | ||
* Moves the box to the ground | ||
*/ | ||
fun dropBox() { | ||
boxL.position = 0.5 | ||
boxR.position = 0.5 | ||
} | ||
|
||
/* | ||
* Moves box to upright position | ||
*/ | ||
/** | ||
* Moves box to upright position | ||
*/ | ||
fun pickUpBox() { | ||
boxL.position = 0.0 | ||
boxL.position = 0.0 | ||
} | ||
|
||
/* | ||
* Moves the grip to keep pixels in place when [pickUpBox] the box | ||
*/ | ||
/** | ||
* Moves the grip to keep pixels in place when [pickUpBox] the box | ||
*/ | ||
fun gripIn() { | ||
grip.position = 0.2 | ||
} | ||
|
||
/* | ||
* Resets the grip to starting position | ||
*/ | ||
/** | ||
* Resets the grip to starting position | ||
*/ | ||
fun gripOut() { | ||
grip.position = 0.0 | ||
} | ||
} | ||
} |