reference-en
reference-en copied to clipboard
just a detail about analogWrite() reference example code
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.
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