Code for driving arduinos in hardware control and communications