Hi i need help with conversion of data received from serial.
I read hex value 30 8C in binary 00110000 10001100 (16 bit) i need to have result decimal of 561 (i try all but i crash my head on the wall)
so : adc send a 10 bit value with first number "30" as LSB and the MSB (2 bits) are the 2 most left (6-7) of second number in binary other bits 0-5 need to discard
MSB LSB RESULT I NEED IS
10xxxxxxxx 00110000 10 00110000
i try with:
Local $ret = _CommGetLine(@CR, 100, 1000) ; return 308C
$retL =stringtobinary(StringLeft($ret,1)) ; get first char as LSB
$retH = stringtobinary(StringRight($ret,1)) ; get second char
$reth= Bitrotate($retl,2,"W") ; then try but nothing to do
$ret = $reth+$retl ; this sum need to be 561
please help me thanks a lot