dauntless89
Well-known member
Hello,
I am trying to output a square wave using tone(). The frequency is being returned as a float and I would prefer to output the square wave with the decimals intact, for example 12.34 Hz instead of rounding it off, but it appears the function was written to have an integer passed into it as the scope shows it's outputting a casted frequency.
Is there an easy way to pass floats into tone(), or maybe a different routine that would accomplish the same thing? I need to output two of these signals, and am using a T3.6.
Thanks in advance.
I am trying to output a square wave using tone(). The frequency is being returned as a float and I would prefer to output the square wave with the decimals intact, for example 12.34 Hz instead of rounding it off, but it appears the function was written to have an integer passed into it as the scope shows it's outputting a casted frequency.
Is there an easy way to pass floats into tone(), or maybe a different routine that would accomplish the same thing? I need to output two of these signals, and am using a T3.6.
Thanks in advance.