Skip to content

Instantly share code, notes, and snippets.

@li2hub
Created October 3, 2018 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save li2hub/9176c8d7b8f1cbc6623086d52b78d1e1 to your computer and use it in GitHub Desktop.
Save li2hub/9176c8d7b8f1cbc6623086d52b78d1e1 to your computer and use it in GitHub Desktop.
int thresh=500;
void setup(){
Serial.begin(115200);
}
void loop(){
int val=analogRead(A0);
if(val>thresh){
Serial.println("LOW MOISTURE! - Please water the soil");
}
else{
Serial.println("Moisture OK");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment