# Photon interrupt pin high upon wakeup from interrupt or timeout

**URL:** <https://community.particle.io/t/photon-interrupt-pin-high-upon-wakeup-from-interrupt-or-timeout/27606>\
**Category:** Firmware\
**Created:** [November 30, 2016, 1:50am UTC](https://community.particle.io/t/photon-interrupt-pin-high-upon-wakeup-from-interrupt-or-timeout/27606 "2016-11-30T01:50:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 30, 2016, 2:10pm UTC](https://community.particle.io/t/photon-interrupt-pin-high-upon-wakeup-from-interrupt-or-timeout/27606/4 "2016-11-30T14:10:50Z")

</div>

If you use `SYSTEM_THREAD(ENABLED)` in conjunction with `SYSTEM_MODE(SEMI_AUTOMATIC)` your Photon should be ready to `digitalRead()` the PIR pin in less than a second.

Why would you do `digitalWrite(_pin, LOW)` as first action after wake and not immediately `digitalRead(PIR)` to catch the state of the interrupt pin when this is held HIGH for 30sec?  
If it was HIGH, then you have been woken by an interrupt, if it’s not, it’s most likely due to a timed wake.

Also what do you expect to get as result from that?

```cpp
digitalWrite(_pin, LOW);
_detected = digitalRead(_pin);

```

How would you ever read anything else from `_pin` than `LOW`? 😕

* * *

Some related threads (search term _“wake pin time”_)  
[Electron Detect Wakeup from Pin Vs. Timer](https://community.particle.io/t/electron-detect-wakeup-from-pin-vs-timer/25718)  
[Photon WKP Pin Interupt Flag Question](https://community.particle.io/t/photon-wkp-pin-interupt-flag-question/14280)

---

_[View the full topic](https://community.particle.io/t/photon-interrupt-pin-high-upon-wakeup-from-interrupt-or-timeout/27606)._
