Closed mrfabroa closed 2 years ago
I've added a "color" block that generates the constants needed for color comparison. In ev3dev mode, it'll generate either the color number or color name, while in pybricks mode, it'll always generate the Color parameter constants.
Converting blocks to Pybricks appears to not take into account the colors in Pybricks are specified using the Color class. When running Pybricks code generated from Gearsbot on a physical EV3, evaluation of color is not correct. For example
color_sensor_in1.color()
returns Color.RED on an EV3, however, when coded in blocks, referencing color is via name or number. So the Pybricks code below generated in Gearsbot from blocks will not work (not enter the loop when detecting red).