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

Made small modification to rd_unb2c.py to test on the hardware.

parent 795d3868
No related branches found
No related tags found
1 merge request!2Modified the scripts to run on Raspberry Pi.
'''
Read Hardware info form UNB2C
'''
#******************************************#
# Read hardware info from UNB2c
# Created: 2021-05-10
#******************************************#
import sys
import time
......@@ -29,13 +30,17 @@ def rw_eeprom(value=0xAB):
if ret_ack < 1:
print("no device found")
else:
I2C_eeprom.write_bytes(0x00, value)
pr_stri = "Found device at address 0x{:02x}".format(I2C_eeprom.I2C_Address)
print(pr_stri)
# ret_ack = I2C_eeprom.write_bytes(0x00, value)
value = []
ret_ack, ret_value = I2C_eeprom.read_bytes(0x00, 1)
print("read = ", ret_value)
stri = "Wrote to EEPROM: {0}, Read from EEPROM: {1} ".format(value, ret_value)
print(stri)
def front_led(value=0xFF, ADDRESS=0x71):
main_switch = I2C(ADDRESS)
def front_led(value=0xFF):
main_switch = I2C(0x71)
main_switch.bus = I2CBUSNR
ret_ack = main_switch.write_pointer(0x20) #select LED
if ret_ack < 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment