From 474cafb015cb6db72e931f4bcf8f4354150c1c71 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 10 Jan 2024 22:41:08 +0100 Subject: [PATCH] Initial commit. --- power_sequence.ino | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 power_sequence.ino diff --git a/power_sequence.ino b/power_sequence.ino new file mode 100644 index 0000000..f611ca7 --- /dev/null +++ b/power_sequence.ino @@ -0,0 +1,24 @@ +#include +#include + +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(); +} + \ No newline at end of file