Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PGCPSU Testing - pro micro low power
// 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);
}
#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
You can’t perform that action at this time.