// vim:ft=arduino /* CribCandle version 0.1 October 18, 2012 Author : Michel Baily Try to simulate random lighting of a wood fire for Christmas Crib illumination For that purpose, we use 3 LEDs (2 Yellow, 1 Red) blinking randomly */ #define LED_COUNT 3 // Define power excusion. // Half excursion allows to have a possible négative random value... #define HALF_POWER_EXCURSION 40 #define POWER_EXCURSION (HALF_POWER_EXCURSION*2) // Define analogWrite range... #define MIN_VALUE 10 #define MAX_VALUE 240 #define INITIAL_VALUE 125 #define DELAY 70 //Array containing led pin numbers int ledPins[LED_COUNT] = {9,10,11}; //Array containing led current values int ledValues[LED_COUNT] = {INITIAL_VALUE, INITIAL_VALUE, INITIAL_VALUE}; //Initial setup... void setup() { // initialize the led pins as output. for(int i=0;i