Converting frequency to time (SOLVED)

We are assuming for the purposes of this discussion that ..

the number represents the frequency in Hertz; whence t = 1/f in seconds
and you are multiplying by 100000
presumably to get the result in microseconds. (but it SHOULD be 1000000 note extra zero)

1: you need to do the calculation in a way that preserves the resolution. So use

unsigned long cycle_time  = 1000000 / frequency

2:

As your DATA is only precise to 0.1% your result can not be more precise than that, and the display SHOULD show it in that way;

1 Like