Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var Cylon = require('cylon');
Cylon.robot({
connections: {
arduino: { adaptor: 'firmata', port: 'COM3' }
},
devices: {
leds: { driver: 'rgb-led', redPin: 10, greenPin: 9, bluePin: 8 },
},
work: function(my) {
var color;
every((1).second(), function() {
if (color == "ff0000") {
color = "00ff00"
} else
{
color = "ff0000"
};
my.leds.setRGB(color);
});
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment