Created
October 28, 2019 08:06
-
-
Save RobolinkAkademi/5ab3eba4fb97c00e021b43611be3dda7 to your computer and use it in GitHub Desktop.
Arduino baslangic dersleri 3
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
#define buton 7 | |
int buton_durum = 0; | |
void setup() | |
{ | |
for (int i = 2; i < 7; i++) | |
{ | |
pinMode(i, OUTPUT); | |
} | |
pinMode(buton, INPUT); | |
} | |
void loop() | |
{ | |
buton_durum = digitalRead(buton); | |
if (buton_durum == 1) | |
{ | |
for (int a = 2; a < 7; a++) | |
{ | |
digitalWrite(a, HIGH); | |
delay(100); | |
digitalWrite(a, LOW); | |
} | |
for (int b = 7; b > 2; b--) | |
{ | |
digitalWrite(b, HIGH); | |
delay(100); | |
digitalWrite(b, LOW); | |
} | |
} | |
else | |
{ | |
for (int k = 2; k < 7; k++) | |
{ | |
digitalWrite(k, LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment