Basically, would there be any issues using the system_sleep() function in place of ALL delay() calls?
The examples set the watchdog timer duration during the setup, so it would have to use the same sleep time each time it is called, but it would be nicer if a different time could be used (for example: half second in between LED blinks, and 8 seconds inside of a loop 5 times for a 30 second delay). Is that possible?
I was also wondering about any/all other tips for maximizing battery life. I see I can call power_adc_disable(), power_timer0_disable(), power_timer1_disable(), and power_usi_disable(). I can disable ADC during sleep and re-enable after. What about the timers and the USI? Can I disable the USI completely in the setup, or would that prevent me from flashing another program onto it??? I'm worried about that! And do I need timer0 and timer1? It is unclear to me exactly what those are needed for. If I disable them before a sleep call, would it turn off the watchdog timer and not wakeup?
So many questions, but I am learning quickly. Thank you all for your help!
Timer0 generates the interrupt which increments millis(),
/* For various reasons, Timer 1 is a better choice for the millis timer on the '85 processor.*/#define TIMER_TO_USE_FOR_MILLIS 1
QuoteTimer0 generates the interrupt which increments millis(),Are you sure ?From the core_build_options.hQuote/* For various reasons, Timer 1 is a better choice for the millis timer on the '85 processor.*/#define TIMER_TO_USE_FOR_MILLIS 1