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

update for fanspeed MAX6620

parent f0888d61
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ EEPROM = 0x50
###################################
# FAN speed
###################################
MAX6620 = 0x52
MAX6620 = 0x29
REG_GLOBAL = 0x00
REG_TACH_1_MSP = 0x10
......
......@@ -97,6 +97,21 @@ class I2C:
print("Write error")
return ret_ack
def ack_check(self):
bus = smbus.SMBus(self.bus_nr)
try:
print("check ACK")
ret_value = bus.write_quick(self.I2C_Address)
ret_ack = 1
if SLOW:
sleep(0.3)
except IOError, err:
ret_ack = 0
ret_value = 0
if DEBUG:
print("No ACK")
return ret_ack
if __name__ == "__main__":
I2C_Device = I2C(0x40)
I2C_Device.write_bytes(0x00, 0x00)
......
......@@ -50,7 +50,7 @@ class ApspuClass:
#
ret_ack, ret_value = self.dev_i2c_eeprom.read_bytes(0)
if ret_ack < 1:
print("no device found during write")
print("EEPROM not found during write")
return False
else:
self.dev_i2c_eeprom.write_bytes(0x00, data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment