Skip to main content

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.

6
  • 1
    Always present float calculations like this 1.0/440.0 and not 1/440 to prevent these being treated as integer calculations. Avoid using floats in comparisons especially '==' comparisons. Commented Apr 26, 2023 at 4:27
  • 1
    @6v6gt Please read When shouldn't I comment?. If you aren't requesting clarification from the author (or the other couple of reasons to comment on the question) then you should be posting an answer instead. Commented Apr 26, 2023 at 5:40
  • 1
    @6v6gt You may want to look at this. I don't know if it will matter being as old as it is, but you could weigh in on it if you have the interest; I don't. But I would them to make up their minds about it. Commented Apr 26, 2023 at 15:18
  • 1
    @NickGammon One problem with giving a formal answer in such a borderline off topic case (this one could fail if the often applied test "non-Arduino specific" is applied and it does anyway have a general C/C++ look to it) is that the answerer risks losing a couple of Brownie points if someone decides to assert that it is off topic and starts down-voting both the question and the answer. Some answers which I have put considerable effort into, and the OP could not have known that the solution to the problem was "Non-Arduino specific", have ended up with a -1 score. Commented Apr 27, 2023 at 18:22
  • @6v6gt Yeah, I agree. I try to ignore the occasional down-vote as there are people who like to nitpick that sort of stuff. It's true it's really a programming question, but we do have a programming tag after all, so I think programming questions are OK. Especially if beginners to Arduino maybe think that the Arduino has different rules to C++. Commented Apr 27, 2023 at 21:51