can anyone help me to change this coding, so my coding is for run dc motor for every 16 hours....so anyone can help me to change the coding i want the motor run for every 5 minute
#define motorpin1 2
#define motorpin2 3
unsigned long previousTime = 0;
int Counter = 0;
void setup() {
// put your setup code here, to run once:
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
}
void loop() {
unsigned long currentTime = millis();
if (currentTime - previousTime >= 10000) {
Counter++;
previousTime = currentTime;
}
if (Counter >= 5760) {
Counter = 0; // delay for 16 hours
digitalWrite(motorpin1, HIGH);
digitalWrite(motorpin2, LOW);
delay(60000); //On motor for 1 minute
digitalWrite(motorpin1, LOW);
digitalWrite(motorpin2, LOW);
}
}