Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobolinkAkademi/5ab3eba4fb97c00e021b43611be3dda7 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/5ab3eba4fb97c00e021b43611be3dda7 to your computer and use it in GitHub Desktop.
Arduino baslangic dersleri 3
#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