PinAlarm(pin: microcontroller.Pin, value: bool, edge: bool = False, pull: bool = False)¶
Create an alarm triggered by a
microcontroller.Pinlevel. The alarm is not active until it is passed to an
alarm-enabling function, such as
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.
edge (bool) – If
True, trigger only when there is a transition to the specified value of
True, if the alarm becomes active when the pin value already matches
value, the alarm is not triggered: the pin must transition from
valueto trigger the alarm. On some ports, edge-triggering may not be available, particularly for deep-sleep alarms.
pull (bool) – Enable a pull-up or pull-down which pulls the pin to the level opposite that of
value. For instance, if
valueis set to
Truewill enable a pull-down, to hold the pin low normally until an outside signal pulls it high.
The trigger pin.
The value on which to trigger.