Go Down

Topic: Serial.write a float value (Read 8992 times) previous topic - next topic

The Clever Monkey


Unions a so cool! Basically the 'byte binary[4]' and 'float floatingPoint' are joined and share the same memory space, so you can access either, and if you change one, you change the other. You can have so much fun changing the byte array, and seeing what its floating point equivalent is :D


I've done something similar in COBOL, if you can believe it. You can reinterpret all or parts of a display value (backed by any number of binary formats) to do all sorts of unnatural things with it.
I yield() for co-routines.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy