Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: Printing floats with MS_DBG()

Home Forums Mayfly Data Logger Printing floats with MS_DBG() Reply To: Printing floats with MS_DBG()

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));