Hallo
What is the quickest way to get BCD to DEC or Ascii to be displayed on lcd?
How to convert BCD to DEC
Moderator: Benj
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: How to convert BCD to DEC
Not sure how well this will work:
Martin
Code: Select all
dec = (bcd >> 4) * 10 + (bcd & 15)
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: How to convert BCD to DEC
Hi Desdewit,
Glad it's working for you.
If the code that worked was different to what I posted, would you mind posting it please, to help others that may be faced with the same issue.
Or was it the code I posted you used?
Maritin
Glad it's working for you.
If the code that worked was different to what I posted, would you mind posting it please, to help others that may be faced with the same issue.
Or was it the code I posted you used?
Maritin
Martin