Created
May 4, 2021 08:25
-
-
Save yemreeke/21a2a473bf9d13b1e2bc94efc31d133a to your computer and use it in GitHub Desktop.
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
//Verici Devre Kodları | |
int buton=8; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(buton,INPUT); | |
} | |
void loop() { | |
if(digitalRead(buton){ | |
Serial.write(1); | |
delay(300); | |
} | |
} | |
//Alıcı Devre Kodları | |
int led = 8; | |
bool durum = false; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(led, OUTPUT); | |
} | |
void loop() { | |
if (Serial.available()) { | |
if (Serial.read() == 1) { | |
durum = !durum; | |
digitalWrite(led, durum); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment