Skip to content

Instantly share code, notes, and snippets.

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