Skip to content

Instantly share code, notes, and snippets.

@alvesoaj
Created January 18, 2021 00:36
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 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 (aj.alves@zerokol.com)
*/
#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