def __init__(self):
self.sensorAddress = 0x58 # Check before to be sure its the correct address
self.device = smbus.SMBus(1)
self.positions = {'found':False,'1':[0,0],'2':[0,0],'3':[0,0],'4':[0,0]}
# Initialization of the IR sensor
self.initCMDs = [0x30, 0x01, 0x30, 0x08, 0x06, 0x90, 0x08, 0xC0, 0x1A, 0x40, 0x33, 0x33]
for i,j in zip(self.initCMDs[0::2], self.initCMDs[1::2]):
self.device.write_byte_data(self.sensorAddress, i, j)
sleep(0.01)
评论列表
文章目录