Go Down

Topic: Always have to do a Reset (Read 916 times) previous topic - next topic


Oct 12, 2006, 07:54 am Last Edit: Oct 12, 2006, 07:55 am by mitcho Reason: 1
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: [Select]


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


Go Up