-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a18e415
commit f9477c0
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Created by ArduinoGetStarted.com | ||
* | ||
* This example code is in the public domain | ||
* | ||
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-controls-pump | ||
*/ | ||
|
||
// constants won't change | ||
const int RELAY_PIN = 3; // the Arduino pin, which connects to the IN pin of relay | ||
|
||
// the setup function runs once when you press reset or power the board | ||
void setup() { | ||
// initialize digital pin D3 as an output. | ||
pinMode(RELAY_PIN, OUTPUT); | ||
} | ||
|
||
// the loop function runs over and over again forever | ||
void loop() { | ||
digitalWrite(RELAY_PIN, HIGH); // turn on pump 5 seconds | ||
delay(5000); | ||
digitalWrite(RELAY_PIN, LOW); // turn off pump 5 seconds | ||
delay(5000); | ||
} |