Documentation

This commit is contained in:
Konstantin Lampalzer 2021-09-12 13:42:55 +02:00
parent cbe3a379bd
commit 8f2944da71
4 changed files with 40 additions and 1 deletions

View file

@ -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!")