Skip to content

Example code in "Using Motor Controllers with Code" needs improvement #1385

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

Open
Billfred opened this issue Jun 28, 2021 · 2 comments
Open

Comments

@Billfred
Copy link

As it sits, the example code snippet on this page is not friendly to those new to programming. Consider, if you will:

Spark spark = new Spark(0); // 0 is the RIO PWM port this is connected to

This reads dangerously close to Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo; while grammatically correct, it takes far too much expertise to understand what's really going on.

To make this into actionable suggestions:

  1. The name for the Spark in question should be "demoSpark" (and similarly, "demoVictor" in the Victor SP example).
  2. There should be some indication of where these lines of code live in the program, or at least a link to more fleshed out example code; as it sits, only drivetrains have some resources through the link in the first paragraph. Other critical robot elements--intakes, conveyors, shooters, arms, etc--that can rely on simply spinning a solitary motor are out in the cold.
@jasondaming
Copy link
Member

jasondaming commented Jun 29, 2021

I completely agree with 1

2 I think is tricky as advising where that code goes really depends on what it is for and if using command or non command. Other than advising that this needs to happen during initialization what else would you have us do? I am not sure here is the right place for an example unless it was super concise and I am not sure that would give what you want.

Maybe we should also have an additional example that is Hatchbot, but not using the command framework.

I think what would be ideal here is when we get more of the extended Zero to Robot stuff done, which would have something like programming an "intake" or something and we could also link to that.

@Daltz333 Daltz333 mentioned this issue Jul 4, 2021
5 tasks
@UserC2
Copy link
Contributor

UserC2 commented May 14, 2024

As it sits, the example code snippet on this page is not friendly to those new to programming. Consider, if you will:

Spark spark = new Spark(0); // 0 is the RIO PWM port this is connected to

This reads dangerously close to Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo; while grammatically correct, it takes far too much expertise to understand what's really going on.

To make this into actionable suggestions:

  1. The name for the Spark in question should be "demoSpark" (and similarly, "demoVictor" in the Victor SP example).
  2. There should be some indication of where these lines of code live in the program, or at least a link to more fleshed out example code; as it sits, only drivetrains have some resources through the link in the first paragraph. Other critical robot elements--intakes, conveyors, shooters, arms, etc--that can rely on simply spinning a solitary motor are out in the cold.

You could name it motor to be more concise

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

Successfully merging a pull request may close this issue.

4 participants