Cheers tomparkin, I’ve been reading Arduino Cookbook and Arduino for Dummies but I need to do something practical to relate it to so that I can understand what I’m reading.
allthepies, thanks.
So if this is my code….
const int motorPin1 = 7;
const int motorPin2 = 8;
void setup() {
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
}
void loop() {
runMotor1();
runMotor2();
}
void runMotor1() {
digitalWrite(motorPin1, HIGH);
delay(200);
digitalWrite(motorPin1, LOW);
delay(200);
}
void runMotor2 () {
digitalWrite(motorPin2, HIGH);
delay(300);
digitalWrite(motorPin2, LOW);
delay(300);
}
…and I want to run the function ‘runMotor1’ again later in the loop I should just write ‘runMotor1();’ ?