Pages: [1]   Go Down
Author Topic: Always have to do a Reset  (Read 580 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
im learning!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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);

}

« Last Edit: October 12, 2006, 12:55:11 am by mitcho » Logged

Pages: [1]   Go Up
Jump to: