Hot answers tagged

2 votes

if statement does not work with fraction, but works with decimal equivalent

1/440 will be treated as an integer expression, returning zero. To make it work, make one or both operands a floating-point type. In your case: if(t >= (float)1 / 440){ //Fraction t = 0; } Or:...
Nick Gammon's user avatar
  • 37.9k
1 vote

Asynchronous function calls in Arduino sketch

You can definitely make asynchronous code on devices with only one thread. This is what the "static" keyword is for in C. It helps you to setup functions as a "state machine" so ...
amihart's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible