The RGB LED

Volume 2, Page 5 - Control the brightness with JavaScript code

varfive=require('johnny-five');
varboard=newfive.Board();
board.on('ready', function() {
// make sure to connect the RGB leads to the// correct pin numbers on your Arduino boardvargreen=newfive.Led(9);
varred=newfive.Led(10);
varblue=newfive.Led(11);
// In order to use the pulse method, you can// only use PWM pins. More information in// PodPi volume 9 on the PWM featurered.pulse(1000);
green.pulse(1600);
blue.blink(2300);
// change the pulse timings and see what happens
});