Skip to content

Instantly share code, notes, and snippets.

@rwaldron
Last active August 29, 2015 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwaldron/79d666fb5cbebfab25fe to your computer and use it in GitHub Desktop.
Save rwaldron/79d666fb5cbebfab25fe to your computer and use it in GitHub Desktop.
Calibrating a continuous servo and external power warning
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
/*
Assuming a continuous servo is attached to pin 9,
this program can be called as:
node calibrate-servo.js
or
node calibrate-servo.js [some PWM pin number]
*/
var servo = new five.Servo({
pin: process.argv[2] || 9,
type: "continuous"
});
servo.center();
/*
Centering a continuous servo should stop
the horn from moving, ie. completely still.
If the horn is still moving while this program
is running, use a small screw driver to adjust
the trim pot until the horn is still. The trim
pot will be exposed on the side of the servo
*/
});

Always supply your servos with an external source! Failure to do so may result in USB port damage, Arduino damage or Servo damage. If your program crashes, this should be the first thing to check.

@gorhgorh
Copy link

thanks sir, I now should get a continuous servo asap :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment