this is arduino version of motor control program