Skip to content

Instantly share code, notes, and snippets.

@alvesoaj
Created January 18, 2021 00:36
Show Gist options
  • Save alvesoaj/7aaaa9312a91054a7b50028437871c8a to your computer and use it in GitHub Desktop.
Save alvesoaj/7aaaa9312a91054a7b50028437871c8a to your computer and use it in GitHub Desktop.
/*
* AJ Alves ([email protected])
*/
#define PUMP_PIN 2 // Water Pump Pin
void setup() {
Serial.begin(9600); // Serial Port setup
pinMode(PUMP_PIN, OUTPUT); // Set pin as OUTPUT
}
void loop() {
digitalWrite(PUMP_PIN, HIGH); // Set pin HIGH
Serial.println("The Water Pump is ON!");
delay(3000); // Wait 3 seconds
digitalWrite(PUMP_PIN, LOW); // Set pin LOW
Serial.println("The Water Pump is OFF!");
delay(3000); // Wait 3 seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment