#include "ACI_10K_an.h"
// **** INCLUDES *****
#include <LowPower.h>
// Use pin 2 as wake up pin
const int wakeUpPin = 2;
void wakeUp()
{
delay(10);// Just a handler for the pin interrupt.
}
void setup() {
Serial.begin(9600);
// Configure wake up pin as input.
// This will consumes few uA of current.
pinMode(wakeUpPin, INPUT);
}
void loop() {
Aci_10K an10k; //start an instance of the library
//Aci_10K an10k(3.3,12);support for 3.3 volt board and/or 12bit analog read resolution
Serial.print("temp: ");
Serial.println(an10k.getTemp(analogRead(A1)));
delay(1000);
// Allow wake up pin to trigger interrupt on low.
attachInterrupt(0, wakeUp, LOW);
// Enter power down state with ADC and BOD module disabled.
// Wake up when wake up pin is low.
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
//LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF);
// Disable external pin interrupt on wake up pin.
detachInterrupt(0);
// Do something here
// Example: Read sensor, data logging, data transmission.
}