Created
May 14, 2014 19:06
-
-
Save jadonk/40020daa81372b49f736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cylon = require('cylon-beaglebone/node_modules/cylon'); | |
Cylon.robot({ | |
connection: {name: 'beaglebone', adaptor: 'beaglebone'}, | |
device: {name: 'servo', driver: 'servo', pin: 'P9_14'}, | |
work: function(my) { | |
var angle = 45 ; | |
my.servo.angle(angle); | |
every((1).second(), function() { | |
angle = angle + 45 ; | |
if (angle > 135) { | |
angle = 45 | |
} | |
my.servo.angle(angle); | |
}); | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment