You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- Note that this code should also work with Atmega32u4 (used in Leonardo) as it contains more timers than ATmega328P.jfpoilpret– jfpoilpret2014-02-24 05:52:31 +00:00Commented Feb 24, 2014 at 5:52
- 1@Ricardo - Probably 90%+ of small-MCU embedded code uses direct register manipulation. Doing things with indirect utility functions is very much not the common mode of manipulating IO/peripherals. There are some toolkits for abstracting away hardware control (The Atmel ASF, for example), but that's generally written to compile away as much as possible to reduce runtime overhead, and almost invariably requires actually understanding the peripherals by reading the datasheets.Connor Wolf– Connor Wolf2014-02-24 17:26:04 +00:00Commented Feb 24, 2014 at 17:26
- 1Basically, arduino stuff, by saying "here are functions that do X", without really bothering to reference the actual documentation or how the hardware is doing the things it does, is very much not normal. I understand it's value as a introductory tool, but except for quick prototyping, it's not really ever done in actual professional environments.Connor Wolf– Connor Wolf2014-02-24 17:27:58 +00:00Commented Feb 24, 2014 at 17:27
- 1To be clear, the thing that makes arduino code unusual for embedded MCU firmware is not unique to arduino code, it's a function of the overall approach. Basically, once you have a decent understanding of the actual MCU, doing things properly (e.g. using hardware registers directly) takes little to no additional time. As such, if you want to learn real MCU dev, it's much better to just sit down and understand what your MCU is actually doing, rather then relying on someone else's abstraction, which tends to be leaky.Connor Wolf– Connor Wolf2014-02-24 17:30:12 +00:00Commented Feb 24, 2014 at 17:30
- 1Note that I may be a bit cynical here, but a lot the behaviours I see in the arduino community are programming anti-patterns. I see a lot of "copy-paste" programming, the treating of libraries as black-boxes, and just general poor design practices in the community at large. Of course, I'm fairly active on EE.stackexchange, so I may have a somewhat slanted view, since I have some moderator tools, and as such see a lot of the closed questions. There is definitely a bias in the arduino questions I've seen there towards "tell me what to C&P to fix", rather then "why is this not working".Connor Wolf– Connor Wolf2014-02-24 17:39:21 +00:00Commented Feb 24, 2014 at 17:39
| Show 5 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. arduino-uno), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
default