int sensorValue = 0;
int lowVal = 3400;
int ledPin = D0;
void setup() {
// Put initialization like pinMode and begin functions here.
Particle.variable("sensorValue", sensorValue);
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, LOW);
sensorValue = analogRead(A0);
//Serial.println(sensorValue);
if(sensorValue <= lowVal){
//do Something
Particle.publish("Moisture", "HIGH");
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
delay(100);
//lowVal = sensorValue;
}
delay(100);
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .