Good day! I've been stuck for a while and I hope you guys can help me.
I have a binary that I was able to convert to a uint64_t. It's big, so I really needed a uint64_t. I'm having trouble converting it to a char array. Can you help me please? I can do it in a standalone project but not on Arduino
Some roadblocks that I encountered:
I can't use sprintf ("%llu"): It's giving me a result of 0 and further googling shows that it wasn't really implemented
I can't use itoa: Yes, itoa was working for smaller numbers, but i'm dealing with a uint64_t and it seems like it reached its limit and giving me a negative result
I can't use String(123456789): I can use it for other types like int and long, but I can't pass in a uint64_t because it's not supported in the parameters
I'm having trouble using VC include in Visual Studio: When i go to my Project Properties > Configuration Properties > C/C++ > General > Additional Include Drectories and add in the path "**C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include**" Visual Studio deletes it
I appreciate any inputs.
Thanks!
I know this is a very old topic but it is one of the top results on Google when looking for a way to print 64bit integers on Arduino and still seems to be a question that doesn't really have a good simple solution. For that reason, I've created a simple library called Int64String for converting 64bit integers to String, which can be used directly with Serial.print() like this:
When we say unsigned long long int x; (uint64_t x;), the range of x is: 0x0000000000000000 - 0xFFFFFFFFFFFFFFFF. Say, we have a number -- uint64_t x = 0xA123456789123456;. We want string form of this number -- does it mean that we want ASCII codes (0x41, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36) for each of the constituent digits of the given number or ASCII codes (0x31, 0x32, 0x30, 0x30, 0x35, 0x37, 0x35, 0x32, 0x37, 0x34, 0x38, 0x39, 0x30, 0x33, 0x32, 0x36) for each of the constituent digits of the corresponding decimal number?
djGrrr:
I know this is a very old topic but it is one of the top results on Google when looking for a way to print 64bit integers on Arduino and still seems to be a question that doesn't really have a good simple solution. For that reason, I've created a simple library called Int64String for converting 64bit integers to String ….
You may think it's old, but your library saved me hours of searching and experimenting with various solutions.
My project involves receiving IR from any remote, then publishing the received code as an MQTT message. From there my Home Assistant or Node-Red can do whatever is needed.