Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sudheerkumarchowdary authored May 30, 2024
1 parent a18e415 commit f9477c0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions arduino codes/iot_water_pump.ino
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);
}

0 comments on commit f9477c0

Please sign in to comment.