Firmware for a machine sorting Smarties (running on a atmega64)