ltetzner:
This should be simple, but I'y stymied on it.int interval=998000;
Frequency = ((float) 1000000/(float) interval);
Serial.print(Frequency);
Serial.println(" Hz")
The output is "1.00 Hz" Why am I only getting 2 decimal points here?
an int can only hold up to 32767, so interval should be an (unsigned) long or better as you are casting it to float make it a float.
Note that floats have only 7 significant digits in Arduino UNO land.
float interval=9.98e5;
Frequency = 1e6/ interval;
Serial.print(Frequency, 4); // 4 decimals
Serial.println(" Hz")