             if (now - lastStateSwitchTime > DEBOUNCE_SECONDS) {
                 alarmState = 1;
                 lastStateSwitchTime = now;
-                Spark.publish("water_alarm", "on", 60, PRIVATE);
+                Particle.publish("water_alarm", "on", 60, PRIVATE);
             }
         }
     } else {

// Functions
//

// Spark setup
void setup() {
    // initialize our pins I/O
    pins_init();
    
    // tell the world we're online
    Spark.publish("online");
    
    // publish the water variable
    Spark.variable("water", &water, INT);
    
    // publish the alarm state variable
    Spark.variable("alarmState", &alarmState, INT);
}

// Spark loop

            // only alarm if we're past the debounce interval
            int now = Time.now();
            if (now - lastStateSwitchTime > DEBOUNCE_SECONDS) {
                alarmState = 0;
                lastStateSwitchTime = now;
                Particle.publish("water_alarm", "off", 60, PRIVATE);
            }
        }
    }
}

// determine if we're exposed to water or not
