Add encoder resetting, SPI health check
This commit is contained in:
parent
63b8f868c9
commit
0f103cb34d
6 changed files with 138 additions and 80 deletions
|
@ -22,8 +22,10 @@ class IRSensor(object):
|
|||
return Spi.read(Register.IR_3_H, 2)
|
||||
elif sensor == 4:
|
||||
return Spi.read(Register.IR_4_H, 2)
|
||||
|
||||
return 0
|
||||
elif sensor == 5:
|
||||
return Spi.read(Register.IR_5_H, 2)
|
||||
else:
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def set(sensor: int, on: bool):
|
||||
|
@ -38,3 +40,5 @@ class IRSensor(object):
|
|||
Spi.write(Register.IR_3_LED, on)
|
||||
elif sensor == 4:
|
||||
Spi.write(Register.IR_4_LED, on)
|
||||
elif sensor == 5:
|
||||
Spi.write(Register.IR_5_LED, on)
|
Reference in a new issue