Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2017 19:14
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 anonymous/b32bc99686f4dce8c35397993ec68726 to your computer and use it in GitHub Desktop.
Save anonymous/b32bc99686f4dce8c35397993ec68726 to your computer and use it in GitHub Desktop.
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