Skip to content
Snippets Groups Projects

Modified the scripts to run on Raspberry Pi.

1 file
+ 11
6
Compare changes
  • Side-by-side
  • Inline
+ 11
6
'''
#******************************************#
Read Hardware info form UNB2C
# Read hardware info from UNB2c
'''
# Created: 2021-05-10
 
#******************************************#
import sys
import sys
import time
import time
@@ -29,13 +30,17 @@ def rw_eeprom(value=0xAB):
@@ -29,13 +30,17 @@ def rw_eeprom(value=0xAB):
if ret_ack < 1:
if ret_ack < 1:
print("no device found")
print("no device found")
else:
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)
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)
stri = "Wrote to EEPROM: {0}, Read from EEPROM: {1} ".format(value, ret_value)
print(stri)
print(stri)
def front_led(value=0xFF, ADDRESS=0x71):
def front_led(value=0xFF):
main_switch = I2C(ADDRESS)
main_switch = I2C(0x71)
main_switch.bus = I2CBUSNR
main_switch.bus = I2CBUSNR
ret_ack = main_switch.write_pointer(0x20) #select LED
ret_ack = main_switch.write_pointer(0x20) #select LED
if ret_ack < 1:
if ret_ack < 1:
Loading