-
Notifications
You must be signed in to change notification settings - Fork 5
EPS Test Code #85
Copy link
Copy link
Open
Labels
Description
from smbus2 import SMBusWrapper
import time
EPS_ADDRESS = 0x2b
with SMBusWrapper(1) as bus:
bus.write_i2c_block_data(EPS_ADDRESS, 0x41, [0x00])
time.sleep(0.5)
print("on")
while True:
# write_cmd = EPS_ADDRESS << 1
# EPS_ADDRESS = b"0x2b"
# bus.write_i2c_block_data(EPS_ADDRESS, 0x10, [0xE440])
bus.write_i2c_block_data(EPS_ADDRESS, 0x10, [0xE4])
bus.write_i2c_block_data(EPS_ADDRESS, 0x10, [0x44])
# time.sleep(0.5)
# Anything explicit (addresses like 0x10) should be in an enum
# bus.write_i2c_block_data(EPS_ADDRESS, 0x11, [0x30])
time.sleep(0.5)
srikar = bus.read_i2c_block_data(EPS_ADDRESS, 0x10, 2)
print(srikar)
print((srikar[0] * 256 + srikar[1]) * .00893)
time.sleep(0.5)
# bus.write_byte(EPS_ADDRESS, EPS_ADDRESS)
# time.sleep(0.5)
# bus.write_byte(EPS_ADDRESS, 0x40)
# time.sleep(0.5)
# bus.write_byte(EPS_ADDRESS, 0x00)
# print("All PDMs on.")
# time.sleep(3)
########################################
# bus.write_byte(EPS_ADDRESS, write_cmd)
# time.sleep(0.5)
# bus.write_byte(EPS_ADDRESS, 0x40)
# time.sleep(0.5)
# bus.write_byte(EPS_ADDRESS, 0x00)
# print("All PDMs off.")
# time.sleep(0.5)
break
print("Done.")
Reactions are currently unavailable