i looked up the color sensor for vex and saw that only IQ has an actual color sensor and since im using V5 i can only use the Vision sensor because IQ cables aren’t compatible with the V5 brain
Sorry my bad I forgot the colour sensor was not in EDR.
You could try use the 276-2154 line follower sensor(or the 276-2158 light sensor with and external light source) to detect colours because this sensor contains and LDR which outputs an analogue voltage depending on the intensity of the light that hits it. The different colours of the squares should reflect different amounts of light back allowing you to tell them apart.
I have managed to distinguish red, white and blue with this method but I have not tried more colours than this so I have no idea if it will be possible to distinguish all 7 colours of the rubix cube.
If this doesn’t work, A 276-2158 light sensor with an external white light source might work better because it does not contain the infrared(IR) LED and IR colour filter on the LDR sensor that is present on the line follower sensor so the light will be reflected light from the squares will be received better by the LDR which might give a greater range of distinguishable colours.
Frankly though this is a lot of trouble to go through so if you can get the code to work for a vision sensor to do this go for it I think otherwise just allow the starting cube colour patterns to be programmed in by the user which will probably simplify the robot quite a lot.
A cube has 6 sides, therefore 6 colors. If you are referring to the black (or sometimes white) plastic underneath stickers, stickerless cubes exist.
the vision sensor is pretty low resolution and might be hard to distinguish between the colors
yeah sorry don’t know why I wrote 7 colours
It is pretty low resolution, but it should be enough. You really only need to detect 5 colors, you know there should be 9 objects detected on each cube side, so anything you don’t detect you can assume is color 6 (which I would set at white). I have not tried a vision sensor with a cube, but the only issue I see is that yellow and orange may be hard to distinguish. Perhaps this weekend I will give it a look and see if, at least color detection, is feasible.
You could also buy stickers that contrast a lot from each other.