Answers.Body: <p>You can get community support for Pybricks at <a href="https://github.com/pybricks/support" rel="nofollow noreferrer">https://github.com/pybricks/support</a>.</p>
  <p><code>ir.buttons(1)</code> returns a list of pressed buttons, so in this particular program</p>
  <pre><code>if ir.buttons(1) == Button.BEACON:
  </code></pre>
  <p>needs to be changed to</p>
  <pre><code> if Button.BEACON in ir.buttons(1):
  </code></pre>
  <p>This will test <strong>if</strong> <em>item</em> is <strong>in</strong> <em>list</em>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-03T04:42:18.130Z
Answers.Text: Worked perfectly for me.Thank you!
Answers.UserDisplayName: technicguy1
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-29T15:31:57.377Z
Answers.LastActivityDate: 2020-10-30T17:13:27.707Z
Answers.LastEditDate: 2020-10-30T17:13:27.707Z
Answers.UserDisplayName: David Lechner
Body: <p>I am writing an EV3 micropython program meant to test my remote, but it does not work. When I run it, I see no errors at all. Instead, I just see a &quot;play&quot; symbol and the program continuously runs. If I press any buttons on my remote control, nothing at all happens. The code is below:</p>
  <pre><code>#!/usr/bin/env pybricks-micropython
  from pybricks.hubs import EV3Brick
  from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
                                   InfraredSensor, UltrasonicSensor, GyroSensor)
  from pybricks.parameters import Port, Stop, Direction, Button, Color
  from pybricks.tools import wait, StopWatch, DataLog
  from pybricks.robotics import DriveBase
  from pybricks.media.ev3dev import SoundFile, ImageFile
  
  
  # This program requires LEGO EV3 MicroPython v2.0 or higher.
  # Click &quot;Open user guide&quot; on the EV3 extension tab for more information.
  
  
  # Create your objects here.
  ev3 = EV3Brick()
  ir = InfraredSensor(Port.S1)
  # ONLY USE THIS ONE PROGRAM!!!
  while True:
      if ir.buttons(1) == Button.BEACON:
          ev3.light.on(Color.RED)
      else:
          ev3.light.on(Color.GREEN)
  </code></pre>
  <p>Do you have any solutions to this problem? Thanks.</p>
  
Tags: <ev3><programming><remote-control><python><pybricks>
Title: Why doesn't my LEGO Micropython remote control program work?
UserDisplayName: technicguy1
ThreadText: # Why doesn't my LEGO Micropython remote control program work?
  
  (Asked by: username_0 on 2020-10-27)
  
  I am writing an EV3 micropython program meant to test my remote, but it does not work. When I run it, I see no errors at all. Instead, I just see a "play" symbol and the program continuously runs. If I press any buttons on my remote control, nothing at all happens. The code is below:
  
  ```
  #!/usr/bin/env pybricks-micropython
  from pybricks.hubs import EV3Brick
  from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
                                   InfraredSensor, UltrasonicSensor, GyroSensor)
  from pybricks.parameters import Port, Stop, Direction, Button, Color
  from pybricks.tools import wait, StopWatch, DataLog
  from pybricks.robotics import DriveBase
  from pybricks.media.ev3dev import SoundFile, ImageFile
  
  # This program requires LEGO EV3 MicroPython v2.0 or higher.
  # Click "Open user guide" on the EV3 extension tab for more information.
  
  # Create your objects here.
  ev3 = EV3Brick()
  ir = InfraredSensor(Port.S1)
  # ONLY USE THIS ONE PROGRAM!!!
  while True:
      if ir.buttons(1) == Button.BEACON:
          ev3.light.on(Color.RED)
      else:
          ev3.light.on(Color.GREEN)
  
  ```
  
  Do you have any solutions to this problem? Thanks.
  
  **Tags:** ev3, programming, remote-control, python, pybricks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-10-29. Score: 5 | Accepted answer
  
  You can get community support for Pybricks at <https://github.com/pybricks/support>.
  
  `ir.buttons(1)` returns a list of pressed buttons, so in this particular program
  
  ```
  if ir.buttons(1) == Button.BEACON:
  
  ```
  
  needs to be changed to
  
  ```
   if Button.BEACON in ir.buttons(1):
  
  ```
  
  This will test **if** *item* is **in** *list*.
  
  > **Comments:**
  > **username_0**: Worked perfectly for me.Thank you!  
  
  ---
  
  