I did a search but didnt find the solotion. Hopfully you can help me .
I got this lines:
void loop()
{
//Wnt to run this for a x amount for times and then goto the nect to run it for an x amount of times.
So i want to excecute the next piece of code for 1500 times and the switch to the second part of the code and execute it foor 1500 times, then wait for 5 minutes en start over agoain.
//First part
digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
delay(50); // wait for a second
digitalWrite(Relay_3, RELAY_ON);// set the Relay ON
delay(79000); // wait for a second
digitalWrite(Relay_3, RELAY_OFF);// set the Relay OFF
delay(50); // wait for a second
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(5000); // wait for a second
//second part
digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
delay(50); // wait for a second
digitalWrite(Relay_2, RELAY_ON);// set the Relay ON
delay(50); // wait for a second
digitalWrite(Relay_2, RELAY_OFF);// set the Relay OFF
delay(50); // wait for a second
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(5000); // wait for a second
It for an relay board that is controlling a antenna rotor with a wifi antenna to san accespoints. This way i can let it scan with litte steps and all the time.
Oke i aint getting this Maybe i'm to tired of overlooking something. //this is my setup with gooed timing/delays #define RELAY_ON 0 #define RELAY_OFF 1 #define Relay_1 2 // Arduino Digital I/O pin number #define Relay_2 3 #define Relay_3 4 #define Relay_4 5 void setup() { //nitialize Pins so relays are inactive at reset) digitalWrite(Relay_1, RELAY_OFF); digitalWrite(Relay_2, RELAY_OFF); digitalWrite(Relay_3, RELAY_OFF); digitalWrite(Relay_4, RELAY_OFF); //set pins as outputs pinMode(Relay_1, OUTPUT); pinMode(Relay_2, OUTPUT); pinMode(Relay_3, OUTPUT); pinMode(Relay_4, OUTPUT); delay(4000); //Check that all relays are inactive at Reset
Above afcourse the setup an below the Loop
//---( Turn left Full sequence)---
void loop(){
digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
delay(50); // wait for a second
digitalWrite(Relay_3, RELAY_ON);// set the Relay ON
delay(70; // wait for a second
digitalWrite(Relay_3, RELAY_OFF);// set the Relay OFF
delay(50); // wait for a second
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(5000); // wait for a second
}
digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
delay(50); // wait for a second
digitalWrite(Relay_3, RELAY_ON);// set the Relay ON
delay(70); // wait for a second
digitalWrite(Relay_3, RELAY_OFF);// set the Relay OFF
delay(50); // wait for a second
digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
delay(5000); // wait for a second
}
Can i ask you how to do this wwith the code you gave me and the no delay but hold the current timing