setup Repeats!?

Hei. I wrote a program in setup(); and left loop() empty. but the program repeats over and oaver again, it happens when i use the USB-port as a power supply. why? :o

Well, you havent given much to go on (hint: post code / circuit), but my guess is a reset.

but the program repeats over and oaver again

No - prove it post the code.

Setup is only called after a reset. If this is really your problem, which one can only tell with by seeing your code, then this is the reason. As to why the reset occurs all the time can have many reason and it makes no sense at all to speculate about this without seeing your code and your circuit.

Korman

I can’t find the code again. but i made a new one that work, just fine.
/*
/
//----------------------------------------------------
int focusPin=5;
int shootPin=7;
int fotos=30;
//----------------------------------------------------
void setup()
{pinMode(focusPin,OUTPUT);
pinMode(shootPin,OUTPUT);}
// -----------------------------------------------------
void loop()
{while(fotos >0)
{
// hello camera!
digitalWrite(focusPin, HIGH);
delay(250); digitalWrite(focusPin, LOW);
// set camera lens too focus!
digitalWrite(focusPin, HIGH);
delay(5000);
// shot the picture!
digitalWrite(shootPin, HIGH);
delay(250);
// relees focus and shoot button.
digitalWrite(focusPin, LOW);
digitalWrite(shootPin, LOW);
// wait till next shoot time.
delay(1000
60*5); // wait 5 minutes.
fotos–;}}
//-------------------------------------------------------

circuit diagram is on its way.

Leaving aside the fact that you don't account for the 5.5 seconds of delays whilst toggling the shutter and autofocus pins, this:

delay(1000*60*5); // wait 5 minutes

may well not wait five minutes. Try:

delay(1000L*60L*5L); // wait 5 minutes

but i made a new one that work, just fine.

So you are saying that this code works? And the code that showed the so called "problem" can't be found?

So you are saying that this code works? And the code that showed the so called "problem" can't be found?

Good, the problem is solved and our work here is done. ;)

In the Air Force we called that kind of problem a short-between-the-headset.

Lefty

Hi! found out that it was a program in windows vista,
it was running in the background, mukcin up my usb port signals.
Arduino run perfect now. (Sony ericson pc-suit).

Thank you,AWOL!
timeing isseius: minutes: delay(1000L60L5L); !