• The servo module outputs between 1ms and 2ms pulses - which would (at least from Wikipedia) seem to be what you expect for -90 to +90 degree pulses: https://en.wikipedia.org/wiki/Servo_cont­rol

    It tries to clip them to avoid damage to the servo motor. To get -90 you're having to output 0.04*1000/50 = 0.8ms, and 3ms(!!!!) for +90. At 3ms I think you probably are running your servo motor against the endstop, which could blow it up if you leave it there for any time.

    This is a really common thing though and I'm tempted to say that Wikipedia isn't entirely right about the correct range of pulse lengths, so I just changed the module.

    If you upload your code now, but change the initialisation to require("servo").connect(C7,{range:2}); then it'll output from 0.5ms to 2.5ms - and you could tweak the range as you see fit to match your servo.

About

Avatar for Gordon @Gordon started