Mark Lawrence schrieb:
I'm looking at a way of cycling around a sequence i.e. starting at some
given location in the middle of a sequence and running to the end before
coming back to the beginning and running to the start place. About the
best I could come up with is the following, any better id
MRAB schrieb:
The value is MSB * 100 + (LSB>> 4) * 10 + (LSB& 0xF)
i would say
(MSB >> 4)*100 + (MSB & 0xF)*10 + (LSB >> 4)
but who knows
--
http://mail.python.org/mailman/listinfo/python-list
nephish schrieb:
thanks for any tips on this.
I'll try.
In BCD a (decimal) digit is stored in a halfbyte (or a 'nibble'). So, in
a byte
you can store two decimal digits. For instance 42 would be
nibble1 nibble2
0100 0010
42
>>> c=0b0110
>>> c
66
>>> c >> 4