Printing Floats (serial)

Ive been using arduino for a while and i swear i have tried printing floats however now when i try to print some floats now it compiles but seems to hang the processor...

Serial.print("Windspeed = "); Serial.println(WindSpeed,1);

This just writes "0." or whatever the top number is...Then hangs. Any help would be much appriciated...

I think we're going to need to see more code. It is unlikely that either of these statements, by themselves is causing the problem, unless WindSpeed is an integer.

If it is, you asked Serial.print to output the value in base 1. It will take a little while (about forever, actually) to do that.

Windspeed = 0.

I have declared WindSpeed earlier as

float WindSpeed = 0;

Which should work right? Since then ive accumilate-summed it but thats all...Complete mystery...Keeps happening and if i comment out the println data bit it works fine and doesnt hang...or if i set it to 0 point precision...

Turns out if i re-cast them as floats (float(WindSpeed)) it works! strange... Cancel that, it seems to be working really weirdly in some recasting etc...really strange...

Windspeedavg = 1.01 WindDircavg = 0.86 Temp = DATA

The output of this:

double val = double(WindSpeed); Serial.print("Windspeedavg = "); Serial.println(val,2); Serial.print("WindDircavg = "); Serial.println(float(WindDirc),2); Serial.print("Temp = ");/* val = double(Temperature); Serial.println(val, 2); Serial.print("BV = ");/* Serial.println(float(BATTVOLT ),3); / **Serial*.println("DATA");

And anything inculding Temperature seems to stall after "0." after strange

And shorter descriptors (Print("WindDirc = ") -> "WD = " seem to fix it! O.o

Please post your whole program so we can see all details simultaneously.

If printing shorter strings fixes the problem, it is definitely a timing issue. You aren't trying to print all this data from an ISR are you?

Nope, just from my loop bit, I have interrupts in other bits but they are strictly disabled in the main bit of the loop. Its sorted for now, just strange how it varies on the variables so much! Thanks for your help :)