Closed juliancheal closed 9 years ago
Adds support for both Normally Open and Normally Closed relay boards. Can change between the type at creation so that the on/off/toggle functions are mapped correctly, defaults to Normally Open.
var Cylon = require('cylon'); // Initialize the robot Cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } }, devices: { relay: { driver: 'relay', pin: 13, type: "NC" } }, work: function(my) { every((1).second(), function() { my.relay.toggle(); }); }).start();
Very cool, thanks @juliancheal
Adds support for both Normally Open and Normally Closed relay boards. Can change between the type at creation so that the on/off/toggle functions are mapped correctly, defaults to Normally Open.
Usage