Skip to content
Snippets Groups Projects
Commit 0c47fba0 authored by Gijs Schoonderbeek's avatar Gijs Schoonderbeek
Browse files

Modified reading of the POL voltage. Ready to test on HW

parent 7c2de7c9
Branches
No related tags found
1 merge request!2Modified the scripts to run on Raspberry Pi.
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment