mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api/iodevices/Ev3devSensor: add device index
This makes it easy to find the sensor to access additional features through the ev3dev lego-sensor and lego-port classes.
This commit is contained in:
@@ -35,7 +35,13 @@ class LUMPDevice():
|
||||
|
||||
|
||||
class Ev3devSensor():
|
||||
"""Read values with an ev3dev-compatible sensor."""
|
||||
"""Read values of an ev3dev-compatible sensor."""
|
||||
|
||||
sensor_index = 0
|
||||
"""Index of the ev3dev sysfs `lego-sensor`_ class."""
|
||||
|
||||
port_index = 0
|
||||
"""Index of the ev3dev sysfs `lego-port`_ class."""
|
||||
|
||||
def __init__(self, port):
|
||||
"""
|
||||
@@ -49,7 +55,7 @@ class Ev3devSensor():
|
||||
"""Read values at a given mode.
|
||||
|
||||
Arguments:
|
||||
mode (``str``): Mode name.
|
||||
mode (``str``): `Mode name`_.
|
||||
|
||||
Returns:
|
||||
``tuple``: Values read from the sensor.
|
||||
|
||||
Reference in New Issue
Block a user