Continuous servo constructor and methods

The constructor for the continuous servo is reminiscent of the RGB LED constructor, in that it is a property of the Servo object. Otherwise, it looks very similar to the Servo constructor with our PWM hat:

let continuousServo = new five.Servo.Continuous({
controller: "PCA9685",
pin: 0
})

There are three methods we can use with the continuous servo:

Servo.Continuous.cw([speed of 0-1]) // turns the servo clockwise
Servo.Continuous.ccw([speed of 0-1]) // turns the servo counter-clockwise
Servo.Continuous.stop() // stops the servo

Now that we know how to use it and have it wired up, let's write a quick program that lets us play with our continuous servo in the REPL.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.137.67