I would to read last 4 bit of data.
Ex:
Data = FA ' hex
4bit.low = 10 'Dec
4bit.high = 15 'Dec
I would to read last 4 bit of data.
Ex:
Data = FA ' hex
4bit.low = 10 'Dec
4bit.high = 15 'Dec
Last edited by chai98a; - 10th December 2006 at 04:29.
4BitLo = Data & $0F ' = 10
4BitHi = Data >> 4 ' = 15
(See manual or online for & and >> details)
Last edited by paul borgmeier; - 10th December 2006 at 05:27.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thank you paul borgmeier
I have 1 question...
How to convert Hex to Dec?
we try to do 7seg display time.
If we need to show minute 10 , sec 20
n = Value Dig i ' Get digit to display
So, how to store data minute and sec in to Value = 2010 (dec)
Last edited by chai98a; - 10th December 2006 at 15:06.
where the data comes from?
anyways, the following should work
Code:' ' HEX to DEC ' ---------- Decimal=((Hexadecimal>>4)*10)+(Hexadecimal & $0F) ' ' DEC to HEX ' ---------- Hexadecimal=((Decimal/10)<<4)+(Decimal // 10)
Last edited by mister_e; - 10th December 2006 at 19:24.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Chai98a,
If you have enough RAM, it is easier to keep the seconds, minutes, hours, etc., all in their own variable. This saves building and unbuilding combined variables each time a second passes. I have posted two examples of clocks here
http://www.picbasic.co.uk/forum/showthread.php?t=2129
that uses separate variables for each “item”. The code sections of interest for you are at the very end of the programs. The first only has minutes and hours but seconds could easily be added. The second has all three. Check them out and see if they might help.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks