pdu_power_sequence/power_sequence.ino

24 lines
462 B
Arduino
Raw Normal View History

2024-01-10 22:41:08 +01:00
#include <avr/interrupt.h>
#include <avr/sleep.h>
void setup() {
// Define relais pins
pinMode(19, OUTPUT);
pinMode(20, OUTPUT);
}
void loop() {
delay(2000); // Wait for 2 seconds
digitalWrite(19, HIGH); // Poweron Relais #1
delay(2000);
digitalWrite(20, HIGH); // Poweron Relais #2
stop();
}
void stop() {
// Send microcontroller to sleep
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
cli();
sleep_mode();
}