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

Updated APSPU scripts after test with USB-I2C device on labtop.

parent 08c11abe
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ DEBUG=False
ser = serial.Serial()
ser.baudrate = 57600
ser.port = 'COM11'
ser.port = 'COM4'
ser.parity = serial.PARITY_NONE
ser.timeout = 1
......
......@@ -22,9 +22,9 @@ sys.path.insert(0, '.')
import os
# import time
from APSPU_I2C import *
if os.name == "posix":
from I2C_serial_pi import *
else:
#if os.name == "posix":
# from I2C_serial_pi import *
#else:
from I2C_serial import *
......@@ -83,6 +83,7 @@ class ApspuClass:
#
# Function to read all monitoring points of the UniBoard
#
print("Read POLs")
for pol in self.pols:
pol.read_all()
return True
......@@ -112,7 +113,7 @@ class PolClass:
self.vout = 0
self.iout = 0
self.temp = 0
self.pol_dev = I2C(LOC_POLS[self.name])
self.pol_dev = I2C(CTR_POLS[self.name])
self.pol_dev.bus_nr = I2CBUSNR
ret_ack, ret_value = self.pol_dev.read_bytes(1)
if ret_ack < 1:
......@@ -189,10 +190,11 @@ def main():
# Function to test the class, read all info and dump on the screen
#
apspu = ApspuClass()
if apspu.wr_rd_eeprom(value=0x34):
print("read / write EEPROM")
apspu.wr_rd_eeprom(value=0x34)
apspu.read_all()
apspu.print_status()
if __name__ == "__main__":
main
\ No newline at end of file
main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment