R
R
Roman Ivanov2013-12-04 20:41:23
Arduino
Roman Ivanov, 2013-12-04 20:41:23

Is there a ready and working solution for converting from float to char?

Is there a ready and, most importantly, working solution for converting from float to char?
The examples on arduino.cc don't work.
PS The TFT library only understands char. I receive the data in float.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Shpak, 2013-12-05
@dogocat

Did char() disappear somewhere? The main thing is that the passed value should be 0 <= x <= 255
upd: and of course it should be integer.

D
Dmitry Guketlev, 2013-12-04
@Yavanosta

I don't quite understand the question, and I'm not an arduino programmer, but float is a floating point type and char is an integer, how are you going to "translate" float to char? If you need to discard the fractional part, maybe the round, floor or ceil functions will help you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question