sleep() [ Sleep ]

analog() (SystemSleepConfiguration)

SystemSleepConfiguration::analog, analog, SystemSleepConfiguration.analog

// PROTOTYPE
SystemSleepConfiguration& analog(pin_t pin, uint16_t voltage, AnalogInterruptMode trig) 

// EXAMPLE
SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
      .analog(A2, 1500, AnalogInterruptMode::BELOW);

Wake on an analog voltage compared to a reference value specified in millivolts. Can only be used on analog pins. Voltage is a maximum of 3.3V (3300 mV).

The AnalogInterruptMode is one of:

  • AnalogInterruptMode::ABOVE - Voltage rises above the threshold voltage.
  • AnalogInterruptMode::BELOW - Voltage falls below the threshold voltage.
  • AnalogInterruptMode::CROSS - Voltage crosses the threshold volage in either direction.
Analog Wake Support Gen 2 Gen 3
Wake from STOP sleep
Wake from ULTRA_LOW_POWER sleep  
Wake from HIBERNATE sleep