Skip to content

Instantly share code, notes, and snippets.

@pysco68
Created March 21, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pysco68/d7b12254e6ede84c36f413cc361a1028 to your computer and use it in GitHub Desktop.
Save pysco68/d7b12254e6ede84c36f413cc361a1028 to your computer and use it in GitHub Desktop.
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