added logic for switching on external power to the motor shield (not tested)