Made setDutyCycle.m also take direction