![]() The error says that String(float&) is ambiguous, so I'm guessing you have another namespace with a String definition in it which is conflicting with the Arduino version. You can write the received bytes directly to the float variable. (Quite often when you reduce it to the simplest example, you learn what the problem is anyway!) There is no way around dealing with serial bytewise, since the communication over serial relies on bytes as a unit. Generally with these sorts of problems, you should reduce the code to the simplest example which shows the error and post that whole example in the thread. the definitions of some_float and some_value The last example you gave that gives 'similar errors' looks like it should work when you remove the extra open bracket, according to the docs.ĮDIT: in reference to the new error message "> call of overloaded ‘String(float&)’ is ambiguous" can you paste some additional code to show at least: So, you need to determine first, how must you transmit, not by your wants, but by those of the receiver. String stringOne = String(5.698, 3) // using a float and the decimal places Converting a number such as 16.38398908 to ASCII characters will consume 11 bytes (BTW you won't get a float with that many digits) and will (obviously) take longer to transmit. There is an example of this on the doc page you linked: You'll need to convert your float into a String then add the two Strings together. The docs say the + operator only supports adding two String types together. Next, as the error says, you are attempting to add a float value to a String type. First, you have an extra open bracket in all of your tests. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |