Hi everyone,
I have a int number (17) and a float number (15.5) stored on a bin file. I want to print those numbers in a Serial Monitor. I can get the Integer number but not the Float number.
In the console I get:
17.0
0.0
I tried some operations without success:
Any ideas?
Thank you so much!!!!!
I have a int number (17) and a float number (15.5) stored on a bin file. I want to print those numbers in a Serial Monitor. I can get the Integer number but not the Float number.
Code:
byte b[] = loadBytes(gFilename);
float x=0;
x= b[0];
println(x);
x= b[1];
println(x);
In the console I get:
17.0
0.0
I tried some operations without success:
Code:
x =(b[0] << 12);
x =(b[1] << 12) | (b[2] << 8) | (b[3] << 4) | (b[5] << 0);
Any ideas?
Thank you so much!!!!!