code for Arduino control sketch