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_control
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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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_control
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 therange
as you see fit to match your servo.