Skip to content
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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Elevator mech #1

wants to merge 7 commits into from

Conversation

eerinn
Copy link

@eerinn eerinn commented Nov 21, 2024

right bumper makes elevator go up and down


public double position(){
return encoder.getPosition();
}
Copy link
Contributor

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.

Copy link

@proan proan left a 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

Comment on lines 23 to 24
leftelevator = new CANSparkMax (2, MotorType.kBrushless);
rightelevator = new CANSparkMax(3, MotorType.kBrushless);
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants