Serial.print vs. for Particle Boron


I'm fairly new to programming and C++ language and have been tasked with updating a set of code from using Serial.print statements to statements. Most of the changes have been very straightforward (directly replacing "Serial.print" with ""), but one line of code is giving me some trouble (Line 255, seen in the photo, with errors). For reference, we are using a Boron 404X device in version 4.2.0. In my understanding, we are moving from Serial.print statements to statements because we are receiving 0.00 valued data points instead of actual measurements. Does anyone know how to properly format line 255 using to eliminate the associated errors? Thank you! internally uses vsnprintf() and hence does not provide overloads that would take a numeric variable as initial parameter.
The first parameter always has to be a string - in particular it should be a "printf() format" string. (hence the error message about the incompatibel parameter type)

Try this instead"Sleepint for %i", seconds_to_sleep);

I guess you do a lot of these "archaic" multi line prints in your code which may all want to be rewritten to use the full potential of the logging feature :wink:


  float b = 2.5;
  int   w = 7;"%.1f liters of beer plus %i glass%s of wine is %s!"
          , b
          , w, (w == 1 ? "" : "es")
          , "one big headache");

Thank you very much for that explanation; my issue seems to have been resolved! :grinning:

1 Like