Help with basic code

I am trying to build a cheep, semi disposable remote security/game camera that sends photos or video back to me. I want to to use an input, in this case a motion sensor to set off a sequence of relays to take photos with a hacked cell phone and sends them. I only want the sequence to run once each time the motion sensor is tripped, then resetting for the next time it picks up motion. I also want to be able to give the phone time to send the photo prior to trying to send another picture. Any help is really appreciated.

What is it you need help with; the hardware or the software?

Lots of places carry PIRs , you power them up, they sense something and bring an output pin low. Arduino can see that low, control the relays, and control the delay until next low is acted upon.

Some PIRs can have their sensitivity and on-time adusted, and also include a "gate" function that can be hooke up to a light sensitive resister and only trigger when the light is below another adjustable level. I am playing with one such unit now, think I may have purchased it from Mouser.com, ~$10. Or maybe Newark.com. I am using it independently right now, just turning an LED on.

Sorry, I should have been a little more clear. I have all the physical components and I should not have any trouble actually building the device. I am very new to Arduino and I need a little help with the code for this project. I want to have a sensor trigger a set of relays that are hooked to the buttons on the phone as if it were your fingers to send a photo. After reading "Getting started with Arduino" I was able to make up the code below using LEDs in the place of the relays. Right now after I press the button it continues to cycle through the LED sequence as it should, but I want it to only run once when the button is pressed and then reset looking for the next trigger. Thanks for your help

#define LED 9
#define LED 10
#define LED 11
#define LED 12
#define LED 13
#define BUTTON 7

int val =0;
int old_val = 0;
int state = 0;

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(9, OUTPUT); //relay #1
  pinMode(10, OUTPUT); //relay #2
  pinMode(11, OUTPUT); //relay #3
  pinMode(12, OUTPUT); //relay #4
  pinMode(13, OUTPUT); //realy #5
  pinMode(BUTTON, INPUT); 
}

void loop() {
  val = digitalRead(BUTTON);
  if ((val == HIGH) && (old_val == LOW)) { 
    state = 1 - state;
    delay(10);
  }
  old_val = val;
  if (state == 1) {
  digitalWrite(9, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(9, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(10, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(10, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(10, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(10, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(11, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(11, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(10, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(10, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(10, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(10, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(12, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(12, LOW);   // set the LED on
  delay(250);              // wait for a second
   digitalWrite(10, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(10, LOW);   // set the LED on
  delay(250);              // wait for a second
  digitalWrite(13, HIGH);   // set the LED on
  delay(250);              // wait for a second
  
} else {
  digitalWrite(LED, LOW);
}
}

There is nothing in the code to reset state after you detect a button press, so it will continually run the LED cycle. to address this, thie:

  if ((val == HIGH) && (old_val == LOW)) { 
    state = 1 - state;
    delay(10);
  }

could be this:

  if ((val == HIGH) && (old_val == LOW))
    { 
    state = 1;
    }
  else
    { 
    state = 0;
    }
  }

Wow, thanks that did exactly what I needed it to do. My next step is to get the timing and sequence dialed in with the motion sensor. I will post again when I get stuck.