Here’s a nifty MINDSTORMS NXT-based bot that can sort gumballs by their color, using the HiTechnic NXT Color Sensor.

LEGO Mindstorms Gumball Sorter [via] Link