arduino and processing code for bead sorting machine