//----------------------------------------------------- int camPin = 13; // Cam trigger connected to digital pin 8 int cds = 0; int reading; // The setup() method runs once, when the sketch starts void setup() { // initialize the digital pin as an output: pinMode(camPin, OUTPUT); pinMode(cds, INPUT); digitalWrite(camPin, LOW); // set the CAM trigger off Serial.begin(9600); } // the loop() method runs over and over again, // as long as the Arduino has power void loop() { /*digitalWrite(CamPin, HIGH); // set the CAM trigger on, capture image delay(1000); // wait for a second digitalWrite(CamPin, LOW); // set the CAM trigger off delay(4000); // wait for 4 seconds */ reading = analogRead(cds); Serial.println(reading); delay(500); if (reading > 900) { digitalWrite(camPin, HIGH); } else digitalWrite(camPin, LOW); }