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.