Nano and float bas result

Hello,

i"m here to ask for a bad result of float data acquisition on NANO Card.

I'm acquiring, with PulseIn(), the lenght (in µS) of a square wave impulsion.

Next i want to transform it to Second.

The problem is that the Float variable is limited at 0,001, no more decimals available.

I also, tried with Double, and get the same problem.

--> Do you know how to increase the decimal numbers.

thanks

Olivier

The float should have about 6 or 7 significant digits. Perhaps you are doing the math wrong. PulseIn() returns an unsigned long. To convert from microseconds to seconds you would divide by 1000000.0. I think that Serial.print() defaults to 2 decimal places. If you want to print more digits, tell print() how many:

Serial.print(floatValue, 6); // Display with 6 digits after that decimal point.

The double is actually a float : http://arduino.cc/en/Reference/Double

You have to tell the compiler when to calculate with floating point and when with integers. Show us the code, so we can tell what is going on.