I’m currently mucking around with a GPS and wanted to display multiple variables on the same page.
I have the Particle coding down and can read each variable I send individually. however as I’m pretty new to html I’m not sure how to display more than one.
Could anyone give me a hand with some simple sample code that shows more thatn one variable at the same time (preferably in a table),
Just to be sure, since your description is rather vague, are you using particle.publish() or particle.variable()? Those are two very different things and should be treated as such.
Hi @Moors7 thanks for your reply and sorry about my vague description.
The sample you linked works fine however it only shows one variable at a time. In my case I would like at least 2 but proably more varribles on the screen at the same time. I am using spark.publish to send my variables. For instance:
When describing things, can we please stick to their relevant names, e.g. “Publishes” for Particle.publish() or “variables” for Particle.variable(), otherwise thug will get very confusing.
So to recap, you’d like to be able to show multiple publishes on one page/table? If they’re coming from the same device, I’d recommend putting them in one publish, and parsing them in the receiving end. If not, you’re likely to run into the publish limit of 1p/s.
The example above filters out events on their eventname, so you can show multiple events with the same name from different devices. You should be able to adapt that to fit your own eventnames.
Ahh okay sorry @Moors7 I understand the confusion now! Yeah I am talking about publishes. I shall put the them in one singular publish and then change the code on the receiving end. Do you know of any sample code doing this? Does it involve using console.log?
After putting them in the same publish I can read both at the same time but they are still only one item. I’d ideally like some code that seperates the two items. @Moors7