Controlling the DC motors programmatically