cylon/examples/test.js

18 lines
385 B
JavaScript
Raw Normal View History

var cylon = require('..');
2013-10-23 03:33:17 +08:00
// Initialize the robot
var robot = cylon.robot({
connection: { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0' },
device: { name: 'led', driver: 'led', pin: 13 },
2013-10-23 03:33:17 +08:00
work: function() {
robot = this
2013-10-23 03:33:17 +08:00
// we do our thing here
every((1).second(), function() { console.log(robot.led.name); });
2013-10-23 03:33:17 +08:00
}
});
// start working
robot.start();