New answers tagged


There is absolutely no need to use String (for anything, generally...). Instead you can either (if you have it) use std::stoi() or use strtol() on the c_str of the string. ledcWrite(ledChannel, std::stoi(sliderValue) * (10.24)); Or ledcWrite(ledChannel, strtol(sliderValue.c_str(), NULL, 10) * (10.24)); The former just converts into the latter anyway.


I do not know what the “frequencies” have to do with your problem, but I would bet that you would get more reliable results if you handle one NMEA sentence at a time, instead of trying to handle six of them at once, and hoping to get the right ones. Below is a function that processes one complete sentence at a time. It records the sentence to the SD file if ...


Using String.getBytes(buffer, len) to get bytes. "len" is the length to copy, but usually need to add 1 for the end of string '\0'. For example: String s = "123"; int count = s.length(); // lenth() is 3 s.getBytes(buffer, count); // copied "12\0" => HEX(31 32 00) s.getBytes(buffer, count + 1); // copied "123\0" ...

Top 50 recent answers are included