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

Update fake PWM ports to increment their values by 10 #5

Merged
merged 4 commits into from
Dec 27, 2020

Conversation

CoolSpy3
Copy link
Member

Fixes #4.

@CoolSpy3 CoolSpy3 requested a review from brettle December 26, 2020 19:31
Copy link
Member

@brettle brettle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like with an expansion board there can be up to 20 regular PWM channels. See:

https://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/PWMSpeedController.html#%3Cinit%3E(int)

@CoolSpy3
Copy link
Member Author

It looks like EncoderSim caps its input values between 0 and 20 :/

@brettle
Copy link
Member

brettle commented Dec 26, 2020

It looks like EncoderSim caps its input values between 0 and 20 :/

Grumble. Can we use a SimDeviceSim instead?

@CoolSpy3
Copy link
Member Author

It looks like EncoderSim caps its input values between 0 and 20 :/

Grumble. Can we use a SimDeviceSim instead?

I'll look into it.

@CoolSpy3
Copy link
Member Author

This is supplemented by DeepBlueRobotics/DeepBlueSim#10

@CoolSpy3 CoolSpy3 requested a review from brettle December 26, 2020 23:15
Copy link
Member

@brettle brettle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just the one suggestion. If that's all you change, no further approval needed.

encoder = new Encoder(2 * id, 2 * id + 1);
encoderSim = EncoderSim.createForIndex(encodersCreated);
encodersCreated++;
device = SimDevice.create("EncoderSim_SparkMax", id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the other devices don't have "Sim" in their names, I recommend using "CANEncoder_SparkMax".

Side note: Resist the temptation to just use "CANEncoder". My understanding it that technically speaking, two different types of devices can be configure to have the same ID and they will not interfere with each other. Only the combination of device type and CAN ID needs to be unique. So including "_SparkMax" allows use to support that.

@CoolSpy3 CoolSpy3 merged commit fad1cc5 into master Dec 27, 2020
@brettle brettle deleted the fix-pwm-port-numbers branch January 1, 2021 04:25
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.

Smart motor controllers can conflict with dumb ones
2 participants