From be1d30c4c8326f75370aa2a6413953a4ea77cb6e Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Mon, 22 Jul 2019 11:44:56 +0200 Subject: [PATCH] api/ev3devices: add InfraredSensor.keypad --- pybricks/ev3devices.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pybricks/ev3devices.py b/pybricks/ev3devices.py index 490716c..d03679b 100644 --- a/pybricks/ev3devices.py +++ b/pybricks/ev3devices.py @@ -153,6 +153,9 @@ class InfraredSensor(): def buttons(self, channel): """Check which buttons on the infrared remote are pressed. + This method can detect up to two buttons at once. If you press + more buttons, you may not get useful data. + Arguments: channel (int): Channel number of the remote. @@ -162,6 +165,20 @@ class InfraredSensor(): """ pass + def keypad(self): + """Check which buttons on the infrared remote are pressed. + + This method can independently detect all 4 up/down buttons, but + it cannot detect the beacon button. + + This method only works with the remote in channel 1. + + :returns: List of pressed buttons on the remote on selected channel. + :rtype: List of :class:`Button <.parameters.Button>` + + """ + pass + class GyroSensor(): """LEGO® MINDSTORMS® EV3 Gyro Sensor.