123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
-
-
-
-
-
-
- var servoModule = require("jsupm_servo");
-
-
- var servo = new servoModule.ES08A(5);
-
-
-
-
-
-
- function startServo(timeOffset, timeInterval, angle)
- {
-
- setTimeout(function()
- {
-
- setInterval(function()
- {
- servo.setAngle(angle);
- console.log("Set angle to " + angle);
- }, timeInterval);
- }, timeOffset);
-
-
-
- }
-
- startServo(0, 3000, 0);
-
-
- startServo(1000, 3000, 90);
-
-
- startServo(2000, 3000, 180);
-
-
- process.on('SIGINT', function()
- {
- console.log("Exiting...");
- process.exit(0);
- });
|