![]() ![]() using Serial.write() I can send them raw to the Arduino. ![]() So, I came out with the following way: given that on both the Arduino and Processing have 32 bit floats and that both the ATMEL 328 (the microcontroller used by Arduino) and my i386 compatible PC are both big endian processors, I can split the float on Arduino into an array of 4 bytes. Unfortunately, I needed the best precision for my project so the above solutions weren’t actually useful. For a project I’m working on, I had the need to send some float variables computed on the Arduino board to a Processing program running on a computer over a Serial communication Link.Īrduino doesn’t have any “out of the box” way to send float variables over the Serial interface but one could simply send approximations: send the float as an integer and truncate the decimals or send it only with two digit for the decimals.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |