Skip to content

just a detail about analogWrite() reference example code #986

Open
@baffledbybllsht

Description

@baffledbybllsht

On the analogwrite syntax page, the text says not to bother setting a pinmode when using (because it's a timer function). The following example, bigger than life, then sets a pinmode in that very context. I don't know how to edit your fancy docs so I'm putting the suggestion here to change that example.

Edit : upon reflection, I'm not sure whether the text or example is correct, but they ought to agree with each other, in order to be instructional.

Activity

MaderDash

MaderDash commented on Jul 4, 2024

@MaderDash

You're correct; there is a contradiction. In my opinion, you should always set a pin mode. Although the document is correct, I have seen cases where not setting the pin mode causes issues. In my opinion, it should always be set. I am happy to edit the document—just let someone let me know what you want me to do. In my opinion, we should remove the statement that you don't need to set pin modes and just have users always set pin modes. "It's good practice anyway," in my opinion.

@baffledbybllsht Please link the page your refrencing please. :D TY

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @MaderDash@baffledbybllsht

        Issue actions

          just a detail about analogWrite() reference example code · Issue #986 · arduino/reference-en