QuirkyCort / gears

Generic Educational Robotics Simulator
Other
65 stars 41 forks source link

Color Sensor in Python mode #114

Closed mrfabroa closed 2 years ago

mrfabroa commented 2 years ago

When working in Python mode (EV3Dev or Pybricks), the color sensor does not work and always returns 1 (Black) when calling the color function (color_sensor_in3.color()). As shown in the screen shot, the color sensor of the simulator is correct (reading red), however the evaluation of the color from the code is still black (1).

Screen Shot 2022-05-25 at 2 02 32 PM

while True:
    print(color_sensor_in3.color())
QuirkyCort commented 2 years ago

You're reading the color sensor on port 3. That color sensor looks like it's pointing forward; there's nothing reflecting light back, so it shows Black.

If you look at your screenshot, the color sensor on port 3 is showing Black, while the color sensor on port 1 is Red.

mrfabroa commented 2 years ago

🤦🏽‍♂️ wow, I totally looked over the fact that I had a second color sensor on there. My bad