We’re rewarding the question askers & reputations are being recalculated! Read more.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
2answers
112 views

How to display float variables on oled display (0.96'')

I have a similar problem than the discussed here : How to display variables on 0.96" OLED with u8glib library? I'd like to know how can I show float variables in place of int variables. What ...
0
votes
2answers
170 views

Make a float using integers [closed]

I want to make a floating point number that has only one decimal point. I have separate integers for both side. Ex: int n1 = 8; int n2 = 2; I want to make 8.2 as float value using separate ...
0
votes
3answers
2k views

How to use a coma as the decimal separator?

I have a LCD that displays a float variable. I would like to show a comma instead of a dot as the decimal separator. float temp = 23.50; lcd.setCursor(0, 0); lcd.print(temp); I want to show 23,50 ...
1
vote
4answers
2k views

Send serial command and wait for reply

I am new to Arduino and have tried all kinds of code for attempting to achieve this. None with any luck, however. I feel that it should be a relatively easy task and therefore, figured that someone ...
1
vote
2answers
217 views

Is this assignment valid or needs casting?

I have this assignment and while i don't get any error not even warning from the compiler. uint16_t Buffer[40000]; for (int n=0; n<40000 ; n++){ Buffer[n] = (0.99 * cos(((2.0*PI)/40000)*n); } ...
3
votes
6answers
11k views

When is it necessary to use “float” instead of “int”?

I'm very new to Arduino and I am making a code for a pedometer. I have a lot of variables and I have used "int" multiple times, but I just came across a code with "float". Now because my coding ...
9
votes
2answers
2k views

Is there a non-float alternative to pow()?

I've scoured the LANGUAGE REFERENCE in the Arduino web-site, and I can't find a non-Float equivalent to pow() I've got to be missing something big, but for the life of me, I'm stumped! I found pow() ...
1
vote
1answer
218 views

Help avoiding floating point math

I'm using a Texas Instruments DRV2605 haptic controller in my project to drive a LRA vibration motor. I would like to calculate the LRA rated voltage during run time using the formula below as ...