Based on the code used internally by the Particle firmware for printing
String objects (see
StringPrintableHelper in wiring/src/spark_wiring_string.cpp), I have written a small
library that allows printing into a simple buffer. This avoids the reallocation of memory that occurs when using the
The library is available on GitHub and I’ve published it to the Particle
library list so you can add it through the IDE or by use
particle library add printable-buffer using the CLI.