Untitled
unknown
c_cpp
3 years ago
512 B
12
Indexable
#include <Wire.h>
#include <SoftwareSerial.h>
#include "LowPower.h"
const byte rtcPin = 19; //interrupt from RTC
int rpm = 0;
void pin19Interrupt(void) {
rpm++;
}
void setup() {
Serial.begin(9600);
pinMode(rPin, INPUT);
pinMode(wPin, INPUT);
pinMode(rtcPin, INPUT);
}
void loop() {
Serial.println("Entering sleep mode");
attachInterrupt(RTCINT, pin19Interrupt, FALLING); //rtc
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
delay(1);
}
Editor is loading...