wijnendael
Member
I am looking at making a binary clock so have just taken a look at the code example supplied with the binary clock project kit and i am at a bit of a loss trying to understand a section. Can someone please explain what is happening here so that i can understand it better or point me to the location in the manual as i donts seem to be able to find it. It is the sections AND %00001111 etc.
the code is:-
the code is:-
Code:
bcd_bin:
' convert the DS1307 BCD values to binary
temp = mins AND %00001111
mins = mins AND %11110000 * 10 / 16 + temp
temp = hours AND %00001111
hours = hours AND %11110000 * 10 / 16 + temp
temp = days AND %00001111
days = days AND %11110000 * 10 / 16 + temp
temp = months AND %00001111
months = months AND %11110000 * 10 / 16 + temp
' convert 24 hour clock values to 12 hour clock
if hours < 13 then do_return
hours = hours - 12
do_return:
return