Wiring Particle with a button to use in a node.js app

Hello all,

I’m getting into programming and have built a couple of full stack apps to learn my way around node, and now I’m trying to set one up so that a particle with a button attached to it can make a POST request and create an entry in a database (the model would be very simple, and the only data that needs to be in the database is the duration of the button being held down, for starters).

That said, I’m really not familiar with wiring up a Particle, so I was hoping someone might be able to point me in the direction of a diagram that shows how this can be done, please?

I need something like this:

But for a Particle, not an Arduino Uno.

Any help would be greatly appreciated!

OK, nevermind, guess I just needed to rubber-duck the question, but got it wired & set up! :grin:

Was just about to :wink:

But you could drop the pulldown and just use

void setup()
  pinMode(D0, INPUT_PULLDOWN);

But actually I’d go for INPUT_PULLUP and have the switch close to GND.
This would save you to chose between 3V3 or Vin for the switch’s active level :wink:

1 Like

Here is a pinout diagram for the Photon just in case you need it: