Arduino setup not working

Connecting pins 6 and 7 to ground makes the motor spins cw and acw, when the neither are connected to ground the motor doesnt spin.
Similar to how this works: http://www.instructables.com/id/Arduino-Button-with-no-resistor/