A datatype in C/C++ which stores a single-precision floating point number.

learn more… | top users | synonyms

0
votes
1answer
19 views

Max double value or NAN as a sentinel value?

I am in need of a sentinel value to use to assign to a double variable initially. 0 or -1 won't work because these values are valid values in my computation and I need a value that will stand out. ...
0
votes
1answer
28 views

build fixed size strings from floats

This is likely a duplicate, but I couldn't find the original question. This is really basic, but just can't figure it out. I'm trying to combine a few char arrays together. This is what I've tried so ...
1
vote
2answers
91 views

Avoiding float math to speed up arduino

I read and heard that the floating point math is much slower than int math. And I saw a converting process in here floath math to integer math So I want to to convert my floating math calculations ...
0
votes
1answer
101 views

DS18B20 Temperature Sensor return as float function returning null 50% of the time

I just got an DS18B20 Temperature sensor and am trying to modify the example code to use a function instead. Below is my getTemp function. It's working but returning results with a 0 value part of the ...
1
vote
1answer
43 views

How to speed up

I found that using more float variable in arduino uno(atmega328p) slows it down (very muck that i can get slow response) so, how to speed up it processing ? my data are euler's angle with 2 digits ...
0
votes
1answer
28 views

How to append float value of into a string ?

I have a float variable lng = 33.785469 and lat = 78.126548. Now can I convert them to String and append in a String variable "my_location" as "your location is \nlng = 33.785469 \nlat = 78.126548". I ...
0
votes
1answer
77 views

Store TinyGPS++ latitude value into a variable of type string or float

I want to get the GPS ordinates in degrees with 6 decimal accuracy. I can obtain this by creating a gps object with TinyGPS library. but In the TinyGPS example codes, its written ...
0
votes
1answer
30 views

Problem assign float to an embed class within the Linked-list libary

I have successfully implemented some code which uses a linked-list. Everything is working, except assigning a value to a float within the embeded class. When I run the code below, I get the expected ...
0
votes
3answers
211 views

How to cast float into four bytes?

I'm trying to save GPS coordinates to an EEPROM. In this example I feed it the latitude of 56060066 as the argument float x void writeFloat(unsigned int addr, float x) { byte seriesOfBytes[3]; ...
1
vote
2answers
4k views

Sending and receiving different types of data via I2C in Arduino

I have found a few good tutorials on how to send and receive data via I2C in connected arduinos. My limitation is now how to transmit different types of data like for instance, long, float, etc. Right ...
1
vote
4answers
130 views

Float arithmetic vs. int arithmetic - is there any power penalty?

It is widely known that float arithmetic takes longer (that is, eats more cycles) than fixed-point (or integer, or bitwise arithmetic), and that surely is something to consider for speed- and ...
1
vote
1answer
113 views

Assembling a float from an array of bytes

I would like to convert an array of bytes, received from serial, to a float. Let's consider this exemple. I'm sending 0.12 byte-wise from an Android application. The conversion from float to array of ...
2
votes
1answer
118 views

Store floats in and reading them from flash

How do I store floats in flash and how do I read them from there? (I need a look-up table for pairs of float values.) The storing part doesn't seem to be so difficult as this compiles: PROGMEM float ...
1
vote
2answers
3k views

float precision in arduino

I am reading a string which i have to convert into a float with a maximum of precision.I didn't want to use toFloat() function since it make a truncation so i made my own code. My problem is that the ...
1
vote
1answer
406 views

Read data from SD

I have logged some data in my sdcard/FAT32 (format). I can read and display them on the serial monitor but additionally I want to use these data as float. Here is my code: byte index = 0; ...
0
votes
1answer
88 views

Serial, Numbers sent as Floating Point and Characters are different at 1e-8 level

I have some code that generates random numbers on the Arduino, it then sends these random numbers firstly, using Serial.print(float data,int lenght) and as a floating point number using the following ...
1
vote
0answers
22 views

Local variables scope anamoly

I have this simple function that produces 2 float values sum and product from which i calculate another varaible NodePrio. I had the value of NodePrio coming wrong so i decided to put in some console ...
0
votes
1answer
247 views

Saving data in a globally declared float array

I'm trying to send 60 float values via serial. Numbers are provided by an accelerometer and saved in a 240 bytes-long array. The array is sent to a function and these values are then copied in a ...
0
votes
2answers
609 views

Sending a floating point number from python to arduino

I am trying to send a floating point number from a python script to an Arduino. I am not sure how to do this, especially in a pythonic way. A little bit of research brought me to this very similar ...