You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in ADS1256.py seems to destroy negative values with an 'and filter'.
if (read & 0x800000):
read &= 0xF000000
Probably this should have been
if (read & 0x800000):
read |= 0xFF000000
so that the output value is compatible with int32
My code for differential readout conversion in python with the fix is:
#v_ref must be float e.g. 5.0
def convert2float(raw_val,v_ref):
if(raw_val>0x7fffff):
return ((raw_val-0x100000000)*v_ref/0x7fffff)
else:
return (raw_val*v_ref/0x7fffff)
The text was updated successfully, but these errors were encountered:
The code in ADS1256.py seems to destroy negative values with an 'and filter'.
Probably this should have been
so that the output value is compatible with int32
My code for differential readout conversion in python with the fix is:
The text was updated successfully, but these errors were encountered: