Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. int lowWaterPin = 10;
  2. int pumpPin = 14;
  3.  
  4. void setup() {
  5. Serial.begin(9600);
  6. pinMode(lowWaterPin, INPUT_PULLUP);
  7. pinMode(pumpPin, OUTPUT);
  8.  
  9. }
  10.  
  11. void loop() {
  12. int x = digitalRead(lowWaterPin);
  13. if (x == LOW) {
  14. digitalWrite(pumpPin,LOW);
  15. Serial.println("pump off?");
  16.  
  17. }
  18.  
  19. if (x == HIGH) {
  20. digitalWrite(pumpPin,HIGH);
  21. Serial.println("pump on?");
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement