The simplest way to control your Christmas lights might be by using a relay that randomly switches the lights
void setup()
{
pinMode(10, OUTPUT);
}
void loop()
{
delay(random(100,1000));
digitalWrite(10, HIGH); // relay on
delay(random(100,1000));
digitalWrite(10, LOW); // relay off
}
you can add a potmeter on the analog port to set the delay values
void setup()
{
pinMode(10, OUTPUT);
}
void loop()
{
digitalWrite(10, HIGH); // relay on
int pot1 = analogRead(A0);
int upper = map(pot1, 0, 1023, 200, 2000);
delay(random(100, upper));
digitalWrite(10, LOW); // relay off
int pot2 = analogRead(A1);
upper = map(pot2, 0, 1023, 200, 2000);
delay(random(100, upper));
}
Merry X-mas
