forked from saygix/Arduino-Uno-and-Image-Processing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proje.ino
34 lines (29 loc) · 895 Bytes
/
proje.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
const int kirmizi = 9;
const int yesil = 8;
const int sari = 10;
void setup() {
pinMode(kirmizi, OUTPUT);
pinMode(yesil, OUTPUT);
pinMode(sari, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
char command = Serial.read();
if (command == '1') {
digitalWrite(kirmizi, HIGH); // Kırmızı LED'i aç
} else if (command == '0') {
digitalWrite(kirmizi, LOW); // Kırmızı LED'i kapat
}
if (command == '2') {
digitalWrite(yesil, HIGH); // Yeşil LED'i aç
} else if (command == '3') {
digitalWrite(yesil, LOW); // Yeşil LED'i kapat
}
if (command == '4') {
digitalWrite(sari, HIGH); // Sarı LED'i aç
} else if (command == '5') {
digitalWrite(sari, LOW); // Sarı LED'i kapat
}
}
}