Last active
June 10, 2017 08:31
-
-
Save DzikuVx/5bb5fafaa7e34267d174cbb0e9ade988 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
#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