Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Printing floats with MS_DBG()

Home Forums Mayfly Data Logger Printing floats with MS_DBG()

Viewing 2 reply threads
  • Author
    • #15118
      Matt Barney

        How can I specify higher floating-point precision when using MS_DBG()? For example:



      • #15119
        Sara Damiano

          The Arduino print function defaults to two decimal places for a float.  Normally, if you were using Serial.print(float) you could control the decimal places with Serial.print(float, decimalPlaces).  But because of the way the MS_DBG macro is written, that won’t work.  You’ll have to create a String from the number and then MS_DBG that:  MS_DBG(String(float, decimalPlaces));

        • #15120
          Matt Barney

            Ah, perfect – thanks Sara!

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.