Thread
:
Sending tuples via bluez?
View Single Post
mailwl
2009-11-28 , 13:38
Posts: 8 | Thanked: 0 times | Joined on Nov 2009
#
5
it works in python for unsigned values:
a = 45
b = 51
val = (a<<8) | b
print val >> 8
print val & 0xFF
--
you my add 99 to both a, b before sending, and minus 99 after:
a = -45 + 99
b = -51 + 99
val = (a<<8) | b
print (val >> 8) - 99
print (val & 0xFF) - 99
to avoid negative values
Last edited by mailwl; 2009-11-28 at
13:42
.
Quote & Reply
|
mailwl
View Public Profile
Send a private message to mailwl
Find all posts by mailwl