Connecting Setup pin to a GPIO?

Hello wonderful Particle community,

I have a P1 design with Setup and a GPIO sharing a button. I can only have one button in my design. User interaction is -

  • Press Once <Do Something 1>
  • Press Twice <Do Something 2>
  • Press Long Once
  • Reset and Press Long

I am handling short presses in my application (through GPIO), but want to retain handling of Listening and Safe modes by Particle firmware (through the setup button). This limits overhead for me as well as keeps safe mode functionality intact in case my application breaks something.

This is working alright for me so far, but I am wondering if I am missing anything? I want to check with the community before committing. Any advice or alternative?

Also, how do I change the press and hold time (3 secs, by default) for listening mode?

Sorry, if this has been asked before in some other form. I would appreciate if you could direct me to the thread.

Thanks!

This thread may be of some interest, Double press of setup button
I think an optional RSSI UI and sleep function is planned later for the setup button although I think it will be possible to disable it.

I assume you’ve got a reset button accessible as well?

Thanks for the share. Interestingly, double tap on at least one of my photon puts it in listening mode. On the P1, I haven’t seen this do anything. It is good to see multiple uses of setup button are planned, and they would be customizable.

No, I do not have a reset button. You can powercycle to reset. For safe mode, I can hold the setup button as I plug in the supply. Do you see any issues with this approach in absence of reset button?

@rahilj

It’s currently a feature on the develop branch but will be removed for the photon and P1 before the next firmware release, so if your photon is running firmware from the develop branch and your P1 is running 0.4.7 you might notice this.
I hadn’t really thought of using a power cycle as an alternative to a reset button, might just pay to check with @BDub that there isn’t other functionality that the reset button provides that is essential for a product?