Pages: [1]   Go Down
Author Topic: Always have to do a Reset  (Read 596 times)
0 Members and 1 Guest are viewing this topic.
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:

int foul1 = 7;  
int foul2 = 9;  

void setup()
  pinMode(foul1, OUTPUT);
  pinMode(foul2, OUTPUT);


void loop() {

    digitalWrite(foul1, LOW);
    digitalWrite(foul2, LOW);

    digitalWrite(foul1, HIGH);

    digitalWrite(foul2, HIGH);

    digitalWrite(foul1, LOW);

    digitalWrite(foul2, LOW);


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

Pages: [1]   Go Up
Jump to: