EDIT: made an edit in the last two paragraphs of this post.
Thanks for the quick responses! Here's the results of my latest attempts with the updated library. For all of this, I haven't modified the moteino m0. Powering through the battery port. In short, the examples in the
RFM69_LowPowerLab library doesn't compile for the reason Jason gave and
LowPower_LowPowerLab library compiles but don't produce power savings. One of the examples in the moteino M0 guide seems to be working correctly, the other seems to have maybe higher than expected current.
The
RFM69_LowPowerLab library examples
DeepSleep and
DeepSleep_usingLowPowerLibrary no longer give the SAMD21 error but now show the
no member named 'powerDown' error that Jason documented.
The
LowPower_LowPowerLab library example
standbyExternalInterruptsSAMD21 now compiles! But the sleep current is 15mA. It was 17mA before sleeping. The power had a weird pattern as shown in the attached picture. Only code modified was deleting the "while(!" before the Serial start.
The
LowPower_LowPowerLab library example
idleWakePeriodic now compiles! But looking at a power analyzer it doesn't seem to do anything. I guess that's because the example code only looks for AVRs?
// **** INCLUDES *****
#include "LowPower.h"
void setup()
{
delay(1000);
// No setup is required for this library
}
void loop()
{
// Enter idle state for 8 s with the rest of peripherals turned off
// Each microcontroller comes with different number of peripherals
// Comment off line of code where necessary
#if defined (__AVR_ATmega328P__) || defined (__AVR_ATmega168__)
LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF,
SPI_OFF, USART0_OFF, TWI_OFF);
#elif defined __AVR_ATmega644P__ || defined (__AVR_ATmega1284P__)
LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF,
TIMER1_OFF, TIMER0_OFF, SPI_OFF,
USART1_OFF, USART0_OFF, TWI_OFF);
#endif
// ATmega32U4
//LowPower.idle(SLEEP_8S, ADC_OFF, TIMER4_OFF, TIMER3_OFF, TIMER1_OFF,
// TIMER0_OFF, SPI_OFF, USART1_OFF, TWI_OFF, USB_OFF);
// ATmega2560
//LowPower.idle(SLEEP_8S, ADC_OFF, TIMER5_OFF, TIMER4_OFF, TIMER3_OFF,
// TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART3_OFF,
// USART2_OFF, USART1_OFF, USART0_OFF, TWI_OFF);
// ATmega256RFR2
//LowPower.idle(SLEEP_8S, ADC_OFF, TIMER5_OFF, TIMER4_OFF, TIMER3_OFF,
// TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF,
// USART1_OFF, USART0_OFF, TWI_OFF);
// Do something here
// Example: Read sensor, data logging, data transmission.
}
With the
https://lowpowerlab.com/guide/moteino/moteinom0/ example called
Deep Sleep which seems to be for external interrupts, I get
1.4mA. EDIT: I forgot to uncomment the line defining the radio. I get 100uA now, which is a somewhat higher than expected, right?
With the
https://lowpowerlab.com/guide/moteino/moteinom0/ example called
periodic sleep using RTCZero I get 11uA sleep
if I add lines to sleep the radio and flash. Of note, the sleeping period appears to consistently be just under 4 seconds instead of 3 seconds.
Appreciate all the help! It's a great product Felix