Hi, ive made a simple program to switch LEDS on and off. I keep my arduino stored in a box with a 9v battery and a power switch.
the switching works fine until i turn the board off.
everytime i turn the power back onto the arduino board, nothing happens. i have to do a manual reset before anything will happen again.
Why do i have to keep reseting. is there some code i can put to make sure the program starts as soon as i turn power on?
here is my code:
//ASSIGN PINS//
int foul1 = 7;
int foul2 = 9;
void setup()
{
pinMode(foul1, OUTPUT);
pinMode(foul2, OUTPUT);
}
void loop() {
digitalWrite(foul1, LOW);
digitalWrite(foul2, LOW);
delay(2000);
digitalWrite(foul1, HIGH);
delay(1500);
digitalWrite(foul2, HIGH);
delay(1500);
digitalWrite(foul1, LOW);
delay(1500);
digitalWrite(foul2, LOW);
delay(10000);
}