Created
March 21, 2019 10:59
-
-
Save pysco68/d7b12254e6ede84c36f413cc361a1028 to your computer and use it in GitHub Desktop.
PGCPSU Testing - pro micro low power
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WARNING: | |
// flashing this to your Pro-Micro will make it unavailable for USB flashing | |
// because the USB-Endpoint isn't polled during deep sleep. You'll have to | |
// recover it by re-flashing the bootloader. | |
// | |
// For example using another Arduino as a ISP: | |
// https://forum.arduino.cc/index.php?topic=363341.msg2505698#msg2505698 | |
// | |
// NOTE: | |
// This sketch requires the library Low-Power to be installed (use package manager): | |
// https://github.com/rocketscream/Low-Power | |
#include <LowPower.h> | |
#define RXLED_PIN 17 | |
void setup() { | |
pinMode(RXLED_PIN, OUTPUT); | |
} | |
void loop() { | |
LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF); | |
digitalWrite(RXLED_PIN, LOW); | |
LowPower.powerDown(SLEEP_15MS, ADC_OFF, BOD_OFF); | |
digitalWrite(RXLED_PIN, HIGH); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RXLED_PIN 17 | |
void setup() { | |
pinMode(RXLED_PIN, OUTPUT); | |
} | |
void loop() { | |
delay(1000); | |
digitalWrite(RXLED_PIN, LOW); | |
delay(15); | |
digitalWrite(RXLED_PIN, HIGH); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment