Skip to content

Instantly share code, notes, and snippets.

@penpencool
Last active November 24, 2019 07:20
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 penpencool/9ee2429f276ec33d7b95641932d18681 to your computer and use it in GitHub Desktop.
Save penpencool/9ee2429f276ec33d7b95641932d18681 to your computer and use it in GitHub Desktop.
/*
Example By ArduinoAll.com
สายสีน้ำตาล - VCC 5-24V
สายสีน้ำเงิน - GND
สายสีเหลือง - A0
*/
void setup() {
Serial.begin(9600);
}
void loop() {
if (digitalRead(A0) == 1) {
Serial.println("ArduinoAll Water Detect");
} else {
Serial.println("No Water");
}
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment