[Free][Windows only] UE4Duino 2 - Arduino (COM port) communication

It is! I’ve used it to control lights and stuff like that from inside Unreal. Really cool.

That’s a very interesting way to encode a float. The way I make my conversions in C++ won’t help you with that, because it just breaks apart or put back together actual float/int bytes, in the way they are organized in memory.

I bet you’ve already came up with some algorithm for that, but in case you didn’t, either in Blueprints or C++ I’d do it this way:

  • Let’s call the three bytes A, B and C. A is the integral part and BC the decimal one.
  • A + (B * 256 + C) * 0.001

In Blueprints, I’d write that formula in a Math Expression node and convert it to a macro. That way it’s easy to use it elsewhere and the Math Expression node makes it very performant.

EDIT: Actually, in C++ you can make that formula even faster: A + ((B << 8) + C) * 0.001f