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 yemreeke/21a2a473bf9d13b1e2bc94efc31d133a to your computer and use it in GitHub Desktop.
Save yemreeke/21a2a473bf9d13b1e2bc94efc31d133a to your computer and use it in GitHub Desktop.
//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