Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arduino baslangic dersleri 6
#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
You can’t perform that action at this time.