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

    Join Date
    May 2019
    Posts
    25
    Helped
    0 / 0
    Points
    286
    Level
    3

    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: 85,362, Level: 71
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    14,045
    Helped
    4676 / 4676
    Points
    85,362
    Level
    71

    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: 83,988, Level: 70
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    17,081
    Helped
    3859 / 3859
    Points
    83,988
    Level
    70

    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.

--[[ ]]--