mbed LPC1768 with optocoupler for 5 V output
Look at figure 13 in the datasheet. There is a load resistor between Vcc and the output pin. This is an open collector output, so you can use it to sink current from the motor, but only if you connect the positive of the motor to Vcc externally.