The wiring diagram needs a wire to link the motor and controller earths otherwise you can't control the motor at all. The code supplied waits for pulses, so that process interferes with the PWM. The PWM is inverted relative to the norm. Basically, you need to experiment to get these to work.