Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions helper scripts/common-commands.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
All of these commands should be run while in the directory 'C:\repos\FRC-2025\src'

winget uv install: 'winget install --exact --disable-interactivity --accept-source-agreements --accept-package-agreements --silent --id=astral-sh.uv'

run once per cloned repository (git clone): 'uv tool run pre-commit'

Change to the 'src' directory (i.e, Repos/FRC-2025/src): 'cd src'

sync packages: 'uv run robotpy sync'
run simulation: 'uv run robotpy sim'
deploy code: 'uv run robotpy deploy'
undeploy code: 'uv run robotpy undeploy'
create virtual environment: 'uv venv'
use virtual environment: '.venv\Scripts\activate'

sync packages: 'uv run robotpy --main src sync'
run simulation: 'uv run robotpy --main src sim'
deploy code: 'uv run robotpy --main src deploy'
undeploy code: 'uv run robotpy --main src undeploy'
17 changes: 15 additions & 2 deletions src/robot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import wpilib
import rev

# step 1: define an xbox controller with the name mechCtrl and the id of 1
# step 2: define a sparkMax motor with the ID of 1 and brushless value for type
# step 3: in teleop, make an if else statement that checks if the a button is pressed on mechCtrl
# step 4 bro: when a is pressed, set motor voltage to 1. if not pressed, set motor voltage to zero
# use wpilib docs and rev docs to find out how to define them


class Robot(wpilib.TimedRobot):
def robotInit(self) -> None:
pass
self.mechCtrl = wpilib.XboxController(1)
self.motor = rev.SparkMax(1, rev.SparkLowLevel.MotorType.kBrushless)

self.motor.setVoltage(0)

def robotPeriodic(self) -> None:
pass
Expand All @@ -12,7 +22,10 @@ def teleopInit(self) -> None:
pass

def teleopPeriodic(self):
pass
if self.mechCtrl.getAButton():
self.motor.setVoltage(1)
else:
self.motor.setVoltage(0)


if __name__ == "__main__":
Expand Down