Errors

i was getting a few errors from this sketch. i should mention that i dont have much experience with this at all, i came across this sketch on a older thread and figured i could edit it to do what i need. thank you

//Use constants for the relay pins in case you need to change these later const int relay1 = 6; //Arduino pin that triggers relay #1 const int relay2 = 7; //Arduino pin that triggers relay #2

void setup() //Set pinMode to OUTPUT for the two relay pins pinMode(relay1, OUTPUT); pinMode(relay2, OUTPUT);

void extendActuator() digitalWrite(relay1, HIGH); digitalWrite(relay2, LOW); }

void retractActuator() digitalWrite(relay1, LOW); digitalWrite(relay2, HIGH); }

void stopActuator() digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); }

void loop() extendActuator(); delay(1000);

stopActuator(); delay(1000);

retractActuator(); delay(1000);

stopActuator(); delay(5000);

and figured i could edit it to do what i need.

So? Did you?

By the way, curly braces for function are NOT optional.

Please post your code in code </> tags so it is easier to view.

For one thing:

void setup() 
  //Set pinMode to OUTPUT for the two relay pins
    pinMode(relay1, OUTPUT);
    pinMode(relay2, OUTPUT);

should be:

void setup() {
  //Set pinMode to OUTPUT for the two relay pins
    pinMode(relay1, OUTPUT);
    pinMode(relay2, OUTPUT);

}

Like Paul said. This applies to everything- setup(), loop(), and whatever other functions you may have in your code.

Read the posts at the top of this Forum by Nick Gammon, especially the one about posting programs here using code tags. With over a dozen posts, you should already know about them. You'll get more responses if you follow the guidelines.

//Use constants for the relay pins in case you need to change these later
const int relay1 = 6;   //Arduino pin that triggers relay #1
const int relay2 = 7;   //Arduino pin that triggers relay #2

void setup() {
  //Set pinMode to OUTPUT for the two relay pins
    pinMode(relay1, OUTPUT);
    pinMode(relay2, OUTPUT);
}

  void extendActuator() 
    digitalWrite(relay1, HIGH);
    digitalWrite(relay2, LOW);
}

void retractActuator() 
    digitalWrite(relay1, LOW);
    digitalWrite(relay2, HIGH);
}

void stopActuator() 
    digitalWrite(relay1, LOW);
    digitalWrite(relay2, LOW);
}

void loop() 
    extendActuator();
    delay(1000);

    stopActuator();
    delay(1000);

    retractActuator();
    delay(1000);

    stopActuator();
    delay(5000);

Well, you used code tags so that's good. Did you read replies #1 and #2?

i fixed the errors, thanks everyone it was just the curly brackets missing.

again very new to this all