Color Sort Code

I’ve found that just an optical sensor (make sure to set the integration time
to 5ms) works fine. You might need to have the LED on too.

Just make sure the blocks are funneled to the center before they go past (best results are when the blocks are the same distance away from the sensor every time).

I’ve had best results spinning the color sorting roller really fast.

The way I coded mine is pretty simple. Something like: when you see the wrong color, reverse the color sorting roller for a little bit, then spin it forward again.