I agree with @bko.
You had that right in your initial code and even in the current code in loop()
...
void loop() {
...
// send datas only if required
if (needUpdate == 1) {
sprintf(message,"%d,%d,%d,%d",lightValue,soundValue,moveValue,pushValue);
Particle.publish(myName,message); // sendind data to the cloud eg:
needUpdate = 0;
}
}
Once you correct this, you should be done - otherwise just post the results that you get then.