Initial commit.
This commit is contained in:
commit
474cafb015
24
power_sequence.ino
Normal file
24
power_sequence.ino
Normal file
@ -0,0 +1,24 @@
|
||||
#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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user