Documentation
This commit is contained in:
parent
cbe3a379bd
commit
8f2944da71
4 changed files with 40 additions and 1 deletions
|
@ -11,6 +11,13 @@ class IRSensor(object):
|
|||
|
||||
@staticmethod
|
||||
def read(sensor: int) -> int:
|
||||
"""Read one infrared sensor
|
||||
|
||||
:param sensor: Which sensor to read. Between 1 and 5
|
||||
:raises: IndexError
|
||||
:return: Sensor value. 10 bit accuracy
|
||||
:rtype: int
|
||||
"""
|
||||
if sensor <= 0 or sensor > SENSOR_COUNT:
|
||||
raise IndexError("Invalid sensor specified!")
|
||||
|
||||
|
@ -31,6 +38,11 @@ class IRSensor(object):
|
|||
|
||||
@staticmethod
|
||||
def set(sensor: int, on: bool):
|
||||
"""Turn on / off a IR emitter
|
||||
|
||||
:param sensor: Which sensor to read. Between 1 and 5
|
||||
:raises: IndexError
|
||||
"""
|
||||
if sensor <= 0 or sensor > SENSOR_COUNT:
|
||||
raise IndexError("Invalid sensor specified!")
|
||||
|
||||
|
|
Reference in a new issue