alarm.touch
– Trigger an alarm when touch is detected.
- class alarm.touch.TouchAlarm(*pin: microcontroller.Pin)
Create an alarm that will be triggered when the given pin is touched. The alarm is not active until it is passed to an
alarm
-enabling function, such asalarm.light_sleep_until_alarms()
oralarm.exit_and_deep_sleep_until_alarms()
.- Parameters:
pin (microcontroller.Pin) – The pin to monitor. On some ports, the choice of pin may be limited due to hardware restrictions, particularly for deep-sleep alarms.
Limitations: Not available on SAMD, Nordic, or RP2040.
- pin: microcontroller.Pin
The trigger pin.