support icon indicating copy to clipboard operation
support copied to clipboard

[Bug] Infraredsensor non lego

Open 20100Lego opened this issue 7 months ago • 16 comments

Describe the bug What is the problem? I'm doing some advanced programming with Pybrick (thanks to you!) like a GBC module that writes text with the ball. I saw that the infrared sensor has a class for measuring brightness. I bought a non-Lego infrared sensor (Aliexpress), it works as a distance sensor in the poweredup application. In pybricks if I do sensor = InfraredSensor (Port.A), the script blocks and doesn't go any further, it doesn't output as an error. Do you think it's possible to integrate these sensors to make them pybricks compatible? I'm a computer scientist, I can do tests to determine what the sensor returns on initialisation if you provide me with debugging/testing tools. It would be great if it worked! Thanks in advance!

To reproduce Steps to reproduce the behavior:

  1. Connect an unofficial Infraredsensor sensor
  2. Try to connect sensor = InfraredSensor (Port.A
  3. Script does not go ahead

Expected behavior What did you expect to happen instead? Sensor sends value

Screenshots There is a saying that a picture is worth a 1000 words. Screenshots really help to identify and solve problem

20100Lego avatar Jun 05 '25 21:06 20100Lego