FRC1076 / 2020-Shooter

Working code to test out encoder controlling shooter speed and advancing of balls in queue
MIT License
0 stars 0 forks source link

Move the shooter feature into a subsystem #5

Open mcolinj opened 4 years ago

mcolinj commented 4 years ago

Create a class BallShooter and put it into the subsystem directory. Give it the necessary instance variables so that it can manipulate the shooter state. Add a shoot() method that will run the motor at the specified speed.

mcolinj commented 4 years ago

BallShooter should take either a CAN-ID or a motor controller as an argument to the constructor. Then it can manipulate the motor via its interface.

mcolinj commented 4 years ago

You can these changes in very small increments starting with the existing code.

  1. Create the empty BallShooter.py file and import it into the robot.py
  2. Add the BallShooter class (constructor and shoot methods) fix it up until it imports okay.
  3. then start using it in robot.py (instantiate it in robotInit() as a start)
  4. Remove the prior code bit by bit as you can until only the shooter code remains.