Skip to content
Snippets Groups Projects

Modified the scripts to run on Raspberry Pi.

1 file
+ 12
6
Compare changes
  • Side-by-side
  • Inline
+ 12
6
@@ -80,22 +80,28 @@ def read_pol(node_nr, i2c_addr):
else:
# pr_stri = "Found device at address 0x{:02x}".format(LOC_PWR.I2C_Address)
# print(pr_stri)
ret_ack, vout_mod = LOC_PWR.read_bytes(LP_VOUT, 2)
# vout_mod = int(vout_mod,16)
# vout = calc_lin_3bytes(ret_value, vout_mod)
ret_ack, vout_mod = LOC_PWR.read_bytes(LP_VOUT_MODE, 1)
ret_ack, ret_value = LOC_PWR.read_bytes(LP_VOUT, 2)
vout_mod = int(vout_mod,16)
ret_value = []
ret_value.append(int(raw_value[:2], 16))
ret_value.append(int(raw_value[2:], 16))
vout = calc_lin_3bytes(ret_value, vout_mod)
stri = "Output Current :{0:2.2f} A ".format(iout)
# print(stri)
ret_ack,raw_value = LOC_PWR.read_bytes(LP_IOUT, 2)
ret_value=[]
ret_value.append(int(raw_value[:2],16))
ret_value.append(int(raw_value[2:],16))
iout = calc_lin_2bytes(ret_value)
stri="Output Current :{0:2.2f} A".format(iout)
print(stri)
stri += "Output Current :{0:2.2f} A ".format(iout)
# print(stri)
ret_ack,raw_value = LOC_PWR.read_bytes(LP_temp, 2)
ret_value=[]
ret_value.append(int(raw_value[:2],16))
ret_value.append(int(raw_value[2:],16))
temp = calc_lin_2bytes(ret_value)
stri="temperature :{0:2.2f} Deg C".format(temp)
stri=+ "temperature :{0:2.2f} Deg C".format(temp)
print(stri)
def read_ddr(node_nr = 0, module=0):
Loading