Thanks for the advice, I have tried to post my code correctly below. Still haven't been able to figure out why I'm getting the error message from the first bracket in my
void TURN_ON_CAMERA() function that says:
"a function definition is not allowed here before '{' token". Any advice apprecaited
#include <Arduino.h>
int PIR = 2; // The PIR is conencted to pin 2
int LED = 13; //The LED is connected to pin 13
int PIR_STATUS; //Pir status
int CAM_PWR = 5; // Cam power
int CAM_STAUS;
int SHUTTER = 6;
int NMBR_OF_PICS;//used in a for loop to take three pictures quick and then pause and take a third
void setup() {
pinMode(LED, OUTPUT);
pinMode(PIR, INPUT);
pinMode(CAM_PWR, OUTPUT);
Serial.begin (9600);
pinMode(SHUTTER, OUTPUT);
}
void loop()
{
delay(5000);
PIR_STATUS = digitalRead(PIR);
if (PIR_STATUS == HIGH)
{
Serial.println("MOTION DETECTED");
}
else {
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(250);
Serial.println("NO MOTION");
}
void TURN_ON_CAMERA()
{
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(LED, HIGH);
delay (1000);
digitalWrite(LED, LOW);
delay(3000);
digitalWrite(CAM_PWR, HIGH);
Serial.println ("CAMER A IS ON");
delay(1000);
digitalWrite(CAM_PWR, LOW);
Serial.println ("CAMERA IS OFF");
delay(3000);
Serial.print("CAMERA POWERED ON");
}