-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elevator mech #1
base: main
Are you sure you want to change the base?
Conversation
|
||
public double position(){ | ||
return encoder.getPosition(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a function to reset the encoder value to 0 when the elevator limit switch is triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is great now! Thank you
leftelevator = new CANSparkMax (2, MotorType.kBrushless); | ||
rightelevator = new CANSparkMax(3, MotorType.kBrushless); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to put these motor IDs into the constructor and use well-named constants for them, too. With the IDs buried here in the class, it makes it more difficult for seeing a system-level view. Ideally all motor ID assignments happen in a single configuration file. This makes it easier to change them.
Also, by moving the motor IDs into the constructor you can create multiple instances of this subsystem, should you need them.
right bumper makes elevator go up and down