doc/pupdevices: doc ColorDistanceSensor.remote()

This commit is contained in:
Laurens Valk
2020-03-20 11:13:52 +01:00
parent 661de5f0fe
commit a827491b2b
2 changed files with 22 additions and 0 deletions
+2
View File
@@ -79,6 +79,8 @@ Color and Distance Sensor
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.distance
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.remote
.. rubric:: Built-in light
This sensor has a built-in light. You can make it red, green, blue, or turn
+20
View File
@@ -100,3 +100,23 @@ class ColorDistanceSensor:
to 100 (farthest).
"""
pass
def remote(self, channel, button_1=None, button_2=None):
"""Make the sensor act like a Power Functions 1.0 IR remote.
Choose a channel and up to two buttons to "press". The infrared
receiver behaves just as if responding to the real remote.
The sensor keeps sending the signal (as if you keep pressing the
buttons). It keeps going until you call this method again with
different buttons or no buttons at all.
Arguments:
channel (int): Channel number of the remote.
button_1 (Button): Button of the Power Functions 1.0 IR remote.
Choose ``None`` if you don't want to press
any button.
button_2 (Button): Button of the Power Functions 1.0 IR remote.
Choose ``None`` if you don't want to press
any button.
"""