Skip to content

Instantly share code, notes, and snippets.

@DzikuVx
Last active June 10, 2017 08:31
Show Gist options
  • Save DzikuVx/5bb5fafaa7e34267d174cbb0e9ade988 to your computer and use it in GitHub Desktop.
Save DzikuVx/5bb5fafaa7e34267d174cbb0e9ade988 to your computer and use it in GitHub Desktop.
#include <VirtualWire.h>
uint8_t counter = 0;
void setup() {
/*
* Set TX pin -> Connect FS1000A here
*/
vw_set_tx_pin(12);
/*
* Set RX pin -> Connect XY-MK-5V here
*/
vw_set_rx_pin(11);
/*
* Set transmission speed. Reciver and trasmitter have to use the same speed
*/
vw_setup(1000);
}
void loop() {
char msg[1];
msg[0] = counter;
/*
* Send buffer
*/
vw_send((uint8_t *)msg, 1);
/*
* Wait until trasmission is complete
*/
vw_wait_tx();
counter++;
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment