From 63992c7ad0e06f0d8d176cfd2afc46013ae7fd70 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Mon, 11 Nov 2019 15:29:39 +0100 Subject: [PATCH] doc/ev3devices/AnalogSensor: add passive/active methods --- pybricks/ev3devices.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pybricks/ev3devices.py b/pybricks/ev3devices.py index 2a06883..f24b5d4 100644 --- a/pybricks/ev3devices.py +++ b/pybricks/ev3devices.py @@ -330,3 +330,25 @@ class AnalogSensor(): :ref:`resistance: Ω `: Resistance of the analog device. """ pass + + def active(self): + """Set sensor to active mode. This sets pin 5 of the sensor + port to `high`. + + This is used in some analog + sensors to control a switch. For example, if you use the NXT Light + Sensor as a custom analog sensor, this method will turn the light on. + From then on, ``voltage()`` returns the raw reflected light value. + """ + pass + + def passive(self): + """Set sensor to passive mode. This sets pin 5 of the sensor + port to `low`. + + This is used in some analog + sensors to control a switch. For example, if you use the NXT Light + Sensor as a custom analog sensor, this method will turn the light off. + From then on, ``voltage()`` returns the raw ambient light value. + """ + pass