const unsigned long minutos = 60*1000;
const unsigned long horas = 3600*1000;
const int pin_motor1 = 2;
const int pin_motor2 = 3;
unsigned long tiempo;
int marcha_motor;
void setup() {
pinMode(pin_motor1, OUTPUT);
pinMode(pin_motor2, OUTPUT);
tiempo = millis();
marcha_motor = 1;
}
void loop() {
if (tiempo < millis()) {
tiempo = tiempo + 2 * horas + 30 * minutos;
if (marcha_motor == 1) {
digitalWrite(pin_motor1, HIGH);
digitalWrite(pin_motor2, LOW);
marcha_motor = 2;
}
else {
digitalWrite(pin_motor1, LOW);
digitalWrite(pin_motor2, HIGH);
marcha_motor = 1;
}
}
// Otras instrucciones aquí
}