mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api/pupdevices: add TiltSensor
This class and its methods are subject to change when the complete API for IMUs is introduced.
This commit is contained in:
+12
-8
@@ -205,19 +205,23 @@ Infrared Sensor
|
||||
.. automethod:: pybricks.pupdevices.InfraredSensor.count
|
||||
|
||||
|
||||
.. Tilt Sensor
|
||||
.. ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Tilt Sensor
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. .. autoclass:: pybricks.pupdevices.TiltSensor
|
||||
.. figure:: ../api/images/sensor_tilt.png
|
||||
:width: 35 %
|
||||
|
||||
|
||||
.. autoclass:: pybricks.pupdevices.TiltSensor
|
||||
:no-members:
|
||||
|
||||
.. automethod:: neutral
|
||||
|
||||
.. automethod:: acceleration
|
||||
|
||||
.. automethod:: tilt
|
||||
|
||||
.. automethod:: up
|
||||
.. .. automethod:: neutral
|
||||
|
||||
.. .. automethod:: acceleration
|
||||
|
||||
.. .. automethod:: up
|
||||
|
||||
|
||||
.. Remote Control
|
||||
|
||||
+11
-3
@@ -3,7 +3,7 @@
|
||||
|
||||
"""LEGO® Powered Up motor, sensors, and lights."""
|
||||
|
||||
from ._common import (KeyPad as _KeyPad, Accelerometer as _Accelerometer,
|
||||
from ._common import (KeyPad as _KeyPad,
|
||||
ColorLight as _ColorLight, Motor as _Motor,
|
||||
LightArray as _LightArray, Light as _Light)
|
||||
|
||||
@@ -43,17 +43,25 @@ class RemoteControl:
|
||||
pass
|
||||
|
||||
|
||||
class TiltSensor(_Accelerometer):
|
||||
class TiltSensor:
|
||||
"""LEGO® Powered Up Tilt Sensor."""
|
||||
|
||||
def __init__(self, port):
|
||||
"""TiltSensor(port)
|
||||
"""
|
||||
|
||||
Arguments:
|
||||
port (Port): Port to which the sensor is connected.
|
||||
"""
|
||||
pass
|
||||
|
||||
def tilt(self):
|
||||
"""Measures the tilt relative to the horizontal plane.
|
||||
|
||||
Returns:
|
||||
(:ref:`angle`, :ref:`angle`): Tuple of pitch and roll angles.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class ColorDistanceSensor:
|
||||
"""LEGO® Powered Up Color and Distance Sensor."""
|
||||
|
||||
Reference in New Issue
Block a user