API reference
Each class in ev3dev module inherits from the base Device
class.
-
class
ev3dev.core.
Device
(class_name, name_pattern='*', name_exact=False, **kwargs)
The ev3dev device base class
-
ev3dev.core.
list_device_names
(class_path, name_pattern, **kwargs)
This is a generator function that lists names of all devices matching the
provided parameters.
- Parameters:
- class_path: class path of the device, a subdirectory of /sys/class.
- For example, ‘/sys/class/tacho-motor’.
- name_pattern: pattern that device name should match.
- For example, ‘sensor*’ or ‘motor*’. Default value: ‘*’.
- keyword arguments: used for matching the corresponding device
- attributes. For example, address=’outA’, or
driver_name=[‘lego-ev3-us’, ‘lego-nxt-us’]. When argument value
is a list, then a match against any entry of the list is
enough.
-
ev3dev.core.
list_devices
(class_name, name_pattern, **kwargs)
This is a generator function that takes same arguments as Device class
and enumerates all devices present in the system that match the provided
arguments.
- Parameters:
- class_name: class name of the device, a subdirectory of /sys/class.
- For example, ‘tacho-motor’.
- name_pattern: pattern that device name should match.
- For example, ‘sensor*’ or ‘motor*’. Default value: ‘*’.
- keyword arguments: used for matching the corresponding device
- attributes. For example, address=’outA’, or
driver_name=[‘lego-ev3-us’, ‘lego-nxt-us’]. When argument value
is a list, then a match against any entry of the list is
enough.
-
ev3dev.core.
list_motors
(name_pattern='*', **kwargs)
This is a generator function that enumerates all tacho motors that match
the provided arguments.
- Parameters:
- name_pattern: pattern that device name should match.
- For example, ‘motor*’. Default value: ‘*’.
- keyword arguments: used for matching the corresponding device
- attributes. For example, driver_name=’lego-ev3-l-motor’, or
address=[‘outB’, ‘outC’]. When argument value
is a list, then a match against any entry of the list is
enough.
-
ev3dev.core.
list_sensors
(name_pattern='sensor*', **kwargs)
This is a generator function that enumerates all sensors that match the
provided arguments.
- Parameters:
- name_pattern: pattern that device name should match.
- For example, ‘sensor*’. Default value: ‘*’.
- keyword arguments: used for matching the corresponding device
- attributes. For example, driver_name=’lego-ev3-touch’, or
address=[‘in1’, ‘in3’]. When argument value is a list,
then a match against any entry of the list is enough.
Contents: