Last active
September 11, 2023 11:55
-
-
Save fxprime/1eb12a33e3a18ab90d0b583b2a850e03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Example of Modulemore XKC-Y25-PNP (NO configuration) | |
Sensor ---- Arduino | |
(Brown) VCC = 5v | |
(Yellow) INPUT = digital 5 --> 4.7k ohm --> GND | |
(Blue) GND = GND | |
(Black) Not connected. | |
*/ | |
int XKC_NO_PIN = 5; | |
void setup() { | |
Serial.begin(115200); | |
pinMode(XKC_NO_PIN, INPUT); | |
} | |
void loop() { | |
bool detected = digitalRead(XKC_NO_PIN); | |
if(detected) { | |
Serial.println("Liquid High"); | |
}else{ | |
Serial.println("Liquid Low"); | |
} | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment