Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Created October 28, 2019 11:30
Show Gist options
  • Save RobolinkAkademi/c2ecede3ca21512d486c713b0fbe4874 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/c2ecede3ca21512d486c713b0fbe4874 to your computer and use it in GitHub Desktop.
Arduino projeleri
#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