Skip to content

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

Open
@Billfred

Description

@Billfred

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions