Created
October 28, 2019 11:30
-
-
Save RobolinkAkademi/c2ecede3ca21512d486c713b0fbe4874 to your computer and use it in GitHub Desktop.
Arduino projeleri
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
#include <VirtualWire.h> | |
#define buton 3 | |
char *message; | |
int butonDeger; | |
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode(buton, INPUT); | |
vw_set_ptt_inverted(true); | |
vw_set_tx_pin(12); | |
vw_setup(4000); | |
} | |
void loop() | |
{ | |
butonDeger = digitalRead(buton); | |
if (butonDeger == HIGH) | |
{ | |
message = "1" ; | |
} | |
else | |
{ | |
message = "0" ; | |
} | |
Serial.println(message); | |
vw_send((uint8_t *)message, strlen(message)); | |
vw_wait_tx(); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment