24 lines
462 B
C++
24 lines
462 B
C++
#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();
|
|
}
|
|
|