This is the code for my optical screw sorting machine. The first program (main.cpp) runs on the computer and the second one (screwSorterDebug.ino) runs on a microcontroller (ATmega328) who controls the arm. A serial comunication is used to pass the data form the computer to the microcontroller.