Hot answers tagged

3

The inline modifier doesn't make a sense for methods definitions in separate cpp file. And obviously it makes the code compilable but methods aren't recognized as methods definitions and also it's not recognized as error (that's kinda weird). Anyway, if you wan't inline methods, do it directly inside of class definition.


2

This construct does work in Arduino IDE. In fact, = { 0 } is one of the iconic idioms of C language. It can be used to zero-initialize an object of any type in C. In C++ things are a bit more complicated. It will work for an int [100] array, but in general case you might be better off with = {} initializer to achieve the same effect where applicable. It is ...


1

See Guide to PROGMEM on ESP8266 and Arduino IDE. Since you put your char array into PROGMEM, special functions must be used to load it from flash into RAM; so to load it into a String object, the FlashHelper class must be used. You can simply use the macro FPSTR(progmem_ptr). #include <Arduino.h> void setup() { Serial.begin(115200); Serial....


1

You can use any C++ IDE you like, best when bundled with a compiler, for example Code::Blocks. Assuming you're using Windows: A combination of a decent editor like Notepad++ and some good compiler chain like MinGW will do, too. If you absolutely have to you could also use MS Visual Studio, I don't bother. Then create standard console programs with this main(...


1

You would be better off formatting it nicely instead of relying on String... char macValue[17]; // Don't forget one byte for the terminating NULL... uint64_t mac = ESP.getEFuseMac(); sprintf(macValue, "%016x", mac); client.publish("esp32/ChipID", macValue); However, I'm not certain that sprintf can cope with a 64 bit value like that directly. If not, you ...


Only top voted, non community-wiki answers of a minimum length are eligible