int relayPin = 10; //mixer
int relayPin1 = 9; // shredder
int relayPin2 = 5;
int flag = 0;
void setup() {
pinMode(relayPin, OUTPUT);
pinMode(relayPin1, OUTPUT);
pinMode(relayPin1, OUTPUT);
// Initialize Serial communication
Serial.begin(9600);
delay(100);
Serial.println("Arduino Uno Motor Control Example");
}
void loop(){
if(flag == 0){
digitalWrite(relayPin1, HIGH); // turn on the relay to activate the SHREDDER
delay(2000); //run for 15 minutes
digitalWrite(relayPin1, LOW); // turn off the relay to deactivate the SHREDDER
delay(1000); // wait for 30 seconds
digitalWrite(relayPin, HIGH); // turn on the relay to activate the MIXER (for every 5 minutes the mixer will turn on and off)
delay(2000); // wait for 10 seconds
digitalWrite(relayPin, LOW); // turn off the relay to deactivate the MIXER
delay(1000); // wait for another 10 seconds
digitalWrite(relayPin2, HIGH); // turn on the relay to activate the MIXER (for every 5 minutes the mixer will turn on and off)
delay(2000); // wait for 10 seconds
digitalWrite(relayPin2, LOW); // turn off the relay to deactivate the MIXER
delay(1000); // wait for another 10 seconds
flag = 1; // set flag to 1 to run the code once
}
}