arduino code to handle commands