sleep() [ Sleep ]

analog() (SystemSleepConfiguration)

// 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 Gen 4
Wake from STOP sleep  
Wake from ULTRA_LOW_POWER sleep    
Wake from HIBERNATE sleep      

Gen 4 Devices (RTL872x) (P2, Photon 2, and M-SoM):

Wake on analog is not supported on the P2, Photon 2, or M-SoM.