Bcd TO Decimal

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
matthys
Posts: 3
Joined: Thu Jan 13, 2011 5:25 pm
Has thanked: 1 time
Contact:

Bcd TO Decimal

Post by matthys »

hi can anyone please assist me. i am doing a project where i'm reading an external rtcc via the i2c port. what is the easiest way to read the binary code decimal as decimal and not displaying 89sec instead of 59sec.
i will appreciate any help.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Bcd TO Decimal

Post by medelec35 »

Hi matthys,

Try:
Decimal = (BCD >> 4)*10 + (BCD & 15)
Martin

matthys
Posts: 3
Joined: Thu Jan 13, 2011 5:25 pm
Has thanked: 1 time
Contact:

Re: Bcd TO Decimal

Post by matthys »

thank you very much i'll try it

matthys
Posts: 3
Joined: Thu Jan 13, 2011 5:25 pm
Has thanked: 1 time
Contact:

Re: Bcd TO Decimal

Post by matthys »

Hi Medelec35
Thanks a lot. I've tried it and it is successfull. :P

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Bcd TO Decimal

Post by medelec35 »

That's great!
Thanks for letting us know.
Martin

Post Reply