Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int lowWaterPin = 10;
- int pumpPin = 14;
- void setup() {
- Serial.begin(9600);
- pinMode(lowWaterPin, INPUT_PULLUP);
- pinMode(pumpPin, OUTPUT);
- }
- void loop() {
- int x = digitalRead(lowWaterPin);
- if (x == LOW) {
- digitalWrite(pumpPin,LOW);
- Serial.println("pump off?");
- }
- if (x == HIGH) {
- digitalWrite(pumpPin,HIGH);
- Serial.println("pump on?");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement