Reading multiple pins in html and jquery

To start with, Spark.xxx() is deprecated for years now. Nowadays we use Particle.xxx()
Also Particle.variable() now only uses two parameters as in

  Particle.variable("IoT", status);

You cannot have multiple variables referenced by the same name. How would the device know which "IoT" you mean?
You need one variable per pin you want to register.
Or you have a single variable that holds the state of all pins.
A calculated variable would be an option for that - e.g. one bit per pin in an int or one character in a string to be parsed on the receiving side.

The binary encoding would also work in the return value of your Particle.function().

1 Like