Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created May 25, 2014 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deadprogram/fba1d73ecdef499b6a90 to your computer and use it in GitHub Desktop.
Save deadprogram/fba1d73ecdef499b6a90 to your computer and use it in GitHub Desktop.
var Cylon = require('cylon');
Cylon.robot({
connection: {
name: 'voodoospark',
adaptor: 'voodoospark',
accessToken: 'XXX',
deviceId: 'YYY',
module: 'spark'
},
devices: [{
name: 'left',
driver: 'motor',
pin: "D1",
},
{
name: 'right',
driver: 'motor',
pin: "A7",
},
{
name: 'leftDirection',
driver: 'direct-pin',
pin: "D3",
},
{
name: 'rightDirection',
driver: 'direct-pin',
pin: "D4",
}],
work: function(my) {
my.leftDirection.digitalWrite(1);
my.rightDirection.digitalWrite(0);
my.left.speed(120);
my.right.speed(120);
after((10).second(), function() {my.left.turnOff(); my.right.turnOff();});
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment