Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

AFE4404EVM: Convert hex data to voltage

$
0
0

Part Number:AFE4404EVM

Hi,

I am using python to read out data from AFE4404EVM. Now, how can I aggregate 3 bytes of data and convert it to the voltage?

Here is my code for it. Is it correct?

my_string =ser.read(22)
#[print(x) for x in my_string]
x=my_string[3]
x+=(my_string[4] << 8)
x+=(my_string[4] << 16)
x=float(x & 0x1111111111111111111111)
x=x*1.2/(2^21)

Thanks,


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>