Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
chore: format box api
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Dec 7, 2023
1 parent 1563eaf commit da0e198
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt
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
}
}
}

0 comments on commit da0e198

Please sign in to comment.