Created
October 28, 2019 08:18
-
-
Save RobolinkAkademi/de4d97d1479a3da50465aa4b4cf65503 to your computer and use it in GitHub Desktop.
Arduino baslangic dersleri 6
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 Pot A0 | |
int sure = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
for (int i = 2; i < 7; i++) | |
{ | |
pinMode(i, OUTPUT); | |
} | |
} | |
void loop() | |
{ | |
int pot_deger = analogRead(Pot); | |
sure = map (pot_deger, 0, 1023, 30, 300); | |
Serial.println(sure); | |
for (int a = 2; a < 7; a++) | |
{ | |
digitalWrite(a, HIGH); | |
delay(sure); | |
digitalWrite(a, LOW); | |
} | |
for (int b = 7; b > 2; b--) | |
{ | |
digitalWrite(b, HIGH); | |
delay(sure); | |
digitalWrite(b, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment