From b1cb062c7cea2d877f0e421adcac27679324b207 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Tue, 14 Jan 2020 20:16:40 +0100 Subject: [PATCH] api/nxtdevices: add Temperature Sensor --- doc/api/nxtdevices.rst | 4 ++++ pybricks/nxtdevices.py | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/doc/api/nxtdevices.rst b/doc/api/nxtdevices.rst index cade3c6..4b7562d 100644 --- a/doc/api/nxtdevices.rst +++ b/doc/api/nxtdevices.rst @@ -46,3 +46,7 @@ NXT Ultrasonic Sensor NXT Sound Sensor ^^^^^^^^^^^^^^^^^^^^^ .. autoclass:: pybricks.nxtdevices.SoundSensor + +NXT Temperature Sensor +^^^^^^^^^^^^^^^^^^^^^^ +.. autoclass:: pybricks.nxtdevices.TemperatureSensor diff --git a/pybricks/nxtdevices.py b/pybricks/nxtdevices.py index 78f8cc7..d491331 100644 --- a/pybricks/nxtdevices.py +++ b/pybricks/nxtdevices.py @@ -147,3 +147,25 @@ class SoundSensor(): """ pass + + +class TemperatureSensor(): + """LEGO® MINDSTORMS® NXT Ultrasonic Sensor.""" + + def __init__(self, port): + """ + + Arguments: + port (Port): Port to which the sensor is connected. + + """ + pass + + def temperature(self): + """Measure the temperature. + + Returns: + :ref:`temperature`: Measured temperature. + + """ + pass