Code for a simple Arduino based motor controller