So, basically, I am trying to replicate an experiment with Lucid Dreaming Goggles and I'm having some problems. Since this is the programming site, I wan't to know if this code is faulty, or if it can be improved. I warn you, I have NO prior knowledge in coding, but I do understand some basic functions in the code. Anyhow, here's the sample.
/*
Inception Sleep Goggles
LEDs in the goggles blink an a timed pattern to alert you when you
are dreaming. The program waits 2 hours for you to fall asleep
before starting the blink sequence every 10 minutes.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// We are using Pin 2 on the Attiny85 microcontroller
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);// blink LEDs once to signal power on
delay(2000);
digitalWrite(2, LOW);
delay(7200000); // Wait 2 hours for sleep to start
}
void loop() {
digitalWrite(2, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(2, LOW); // set the LED off
delay(500); // wait for a second
digitalWrite(2, HIGH);
delay(500);
digitalWrite(2, LOW);
delay(500);
digitalWrite(2, HIGH);
delay(250);
digitalWrite(2, LOW);
delay(250);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(600000); //Wait 10 minutes
}
[/table]