Hey,
I am just trying to low the energy consumption of my arduino and so I installed the LowPower(.h) library.
I need to use the Timer0 because I wanna create some kind of a watch. And there comes the problem: if I use "LowPower.idle(SLEEP_1S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF); " everything is allright but if I set the TIMER0 ON (because of my watch application with time.h) the controller does not sleep for 1 second.
The simplest programm I could imagine to show my problem is a modified blink:
that works:
#include <LowPower.h>
/
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
LowPower.idle(SLEEP_1S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF,
SPI_OFF, USART0_OFF, TWI_OFF);
digitalWrite(led, LOW);
LowPower.idle(SLEEP_1S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF,
SPI_OFF, USART0_OFF, TWI_OFF);
}
that not:
#include <LowPower.h>
/
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
LowPower.idle(SLEEP_1S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_ON,
SPI_OFF, USART0_OFF, TWI_OFF);
digitalWrite(led, LOW);
LowPower.idle(SLEEP_1S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_ON,
SPI_OFF, USART0_OFF, TWI_OFF);
}
What can I do to let both run together? Is there a connection between sleep and timer0???
THX
Jonny