Playing with the continuous servo in the REPL

Load your project folder onto the Pi, navigate to the folder in your Pi SSH session, and run the following command:

sudo node continuous-servo-repl.js

Once you see Board Initialized, you can try controlling the continuous servo by entering commands into the Johnny-Five REPL:

continuousServo.cw(1) // see how fast it can go!
continuousServo.ccw(.5) // it changes directions near-instantaneously!
continuousServo.stop() // and stops very quickly, too!

It is because of the ability to change direction and stop quickly that some prefer continuous servos to motors for wheeled robots—it's always great to have options.

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

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