-
Notifications
You must be signed in to change notification settings - Fork 0
/
Code_1.ino
58 lines (43 loc) · 1.13 KB
/
Code_1.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <WiFi.h>
const char* ssid = "WiFi_SSID";
const char* password = "WiFi_PASSWORD";
// Röle pinleri
const int relay1Pin = 23;
const int relay2Pin = 21;
const int relay3Pin = 22;
const int relay4Pin = 19;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("WiFi bağlantısı bekleniyor...");
}
Serial.println("WiFi bağlandı!");
pinMode(relay1Pin, OUTPUT);
pinMode(relay2Pin, OUTPUT);
pinMode(relay3Pin, OUTPUT);
pinMode(relay4Pin, OUTPUT);
digitalWrite(relay1Pin, HIGH);
digitalWrite(relay2Pin, HIGH);
digitalWrite(relay3Pin, HIGH);
digitalWrite(relay4Pin, HIGH);
}
void loop() {
digitalWrite(relay1Pin, LOW);
delay(1000);
digitalWrite(relay1Pin, HIGH);
delay(1000);
digitalWrite(relay2Pin, LOW);
delay(1000);
digitalWrite(relay2Pin, HIGH);
delay(1000);
digitalWrite(relay3Pin, LOW);
delay(1000);
digitalWrite(relay3Pin, HIGH);
delay(1000);
digitalWrite(relay4Pin, LOW);
delay(1000);
digitalWrite(relay4Pin, HIGH);
delay(1000);
}