Loop and publish variable

Particle.variable() is not to be called multiple times for the same variable.
You register a global variable (or function) once in setup() and from then on whenever the cloud requests that variable the value of that variable/function will be sent back.

Also a Particle.variable() is never published/pushed but needs to be requested.
If you want to push data you’d use Particle.publish() (at a rate of no more than 1/second).

BTW, your syntax is outdated.
The correct (current) form is Particle.variable("moister", moister_value);


In addition: Have you tried researching that question in the forum before posting?
This topic has come up and been answered numerous times before already :wink:

https://community.particle.io/t/welcome-using-particle-forums-and-forum-etiquette

3 Likes