djgrrr / int64string Goto Github PK
View Code? Open in Web Editor NEWArduino library for converting 64bit integers to strings
License: MIT License
Arduino library for converting 64bit integers to strings
License: MIT License
Hi ,I had to remove the default parameters in the .cpp file as they are already defined in .h file,otherwise doesn't compile.
Would it be possible to integrate it with the String
class?
so that we can use it as follows:
uint64_t count = 10;
String text = "count: " + count;
example code:
uint64_t string2uint64(const char *str, uint8_t base) {
uint64_t result = 0;
for (int i = 0; str[i] != '\0'; i++)
result = result * base + str[i] - '0';
return result;
}
I dropped the Int64String code verbatim into the build enviroment for ESP32 under ESPHome.
Getting the following compile error when trying to use the code:
src/main.cpp: In lambda function:
src/main.cpp:250:25: error: could not convert 'int64String(int64_t, uint8_t, bool)(10, 1)' from 'String' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
return int64String(ESP.getEfuseMac(),10,true);
Any ideas how to fix this please?
Hello,
I was trying to get a String of the 6-byte MAC address of my ESP32 and I found that the byte order is reversed.
The vendor part of ESP MAC addresses is 80:7D:3A
which should be in the beginning of the string, but the ouput is 38CDD33A7D80
, which puts the byte values correclty but in reverse order.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.