+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Junior Member level 1
    Points: 121, Level: 1

    Join Date
    May 2019
    Posts
    15
    Helped
    0 / 0
    Points
    121
    Level
    1

    LCD arduino printing issue

    hi,
    i have a counter printing values from 0 to 360, with a 0.1 increment in each loop count. however, after a specific value(232), instead of 232.10, the lcd prints 232.11 232.21 232.31 etc.. i tried printing a "0" at the particular position, but doesn't seem to work. can anyone explain why? thanks in advance.

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 80,462, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,183
    Helped
    4403 / 4403
    Points
    80,462
    Level
    69

    Re: LCD arduino printing issue

    You would have to show us your software to be sure but it could be a rounding error due to the math routines or the binary representation of decimal numbers.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 76,224, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,457
    Helped
    3513 / 3513
    Points
    76,224
    Level
    67

    Re: LCD arduino printing issue

    Hi,

    I'd use a 16 bit (integer) counter from 0 to 3599.
    Each LSB representing 0.1.
    Then just set the decimal point at the correct place.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

--[[ ]]--