Skip to content
Snippets Groups Projects

Modified the scripts to run on Raspberry Pi.

2 files
+ 34
35
Compare changes
  • Side-by-side
  • Inline

Files

+ 12
12
@@ -18,10 +18,10 @@ else:
@@ -18,10 +18,10 @@ else:
from I2C_serial import *
from I2C_serial import *
from UniBoard2_I2C import *
from UniBoard2_I2C import *
I2CBUSNR=1
I2CBUSNR=3
LOC_PWR = I2C(LOC_POWER_SUPPLIES[0])
LOC_PWR = I2C(0x53)
LOC_PWR.bus = I2CBUSNR
LOC_PWR.bus = I2CBUSNR
ret_ack, ret_value = LOC_PWR.read_bytes(0)
ret_ack, ret_value = LOC_PWR.read_bytes(0)
if ret_ack < 1:
if ret_ack < 1:
@@ -30,13 +30,13 @@ else:
@@ -30,13 +30,13 @@ else:
pr_stri = "Found device at address 0x{:02x}".format(LOC_PWR.I2C_Address)
pr_stri = "Found device at address 0x{:02x}".format(LOC_PWR.I2C_Address)
print(pr_stri)
print(pr_stri)
value=[]
value=[]
ret_ack,vout_mod = LOC_PWR.read_bytes(LP_VOUT_MODE, 1)
ret_ack,vout_mod = LOC_PWR.read_bytes(0x00, 1)
ret_ack,ret_value = LOC_PWR.read_bytes(LP_VOUT, 2)
# ret_ack,ret_value = LOC_PWR.read_bytes(LP_VOUT, 2)
vout = calc_lin_3bytes(ret_value, vout_mod)
# vout = calc_lin_3bytes(ret_value, vout_mod)
print("vout = ", vout)
print("read = ", vout_mod)
ret_ack,ret_value = LOC_PWR.read_bytes(LP_IOUT, 2)
# ret_ack,ret_value = LOC_PWR.read_bytes(LP_IOUT, 2)
iout = calc_lin_2bytes(ret_value)
# iout = calc_lin_2bytes(ret_value)
print("Output Current :",iout)
# print("Output Current :",iout)
ret_ack,ret_value = LOC_PWR.read_bytes(LP_temp, 2)
# ret_ack,ret_value = LOC_PWR.read_bytes(LP_temp, 2)
temp = calc_lin_2bytes(ret_value)
# temp = calc_lin_2bytes(ret_value)
print("temperature :",temp)
# print("temperature :",temp)
Loading