I have Arduino Uno, Arduino Pro Micro, XY-MK-5V and FS1000A. I need transmit data from Pro Micro to Uno.
Transmitter:
#include <VirtualWire.h>
void setup() {
Serial.begin(9600);
vw_setup(2000);
vw_set_tx_pin(14);
}
void loop() {
send("Test message!");
delay(2000);
}
void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx();
}
Receiver:
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600);
vw_set_rx_pin(12);
vw_setup(2000);
vw_rx_start();
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if(vw_get_message(buf, &buflen))
{
for(int i = 0; i < buflen; i++)
{
Serial.print(buf[i]);
}
Serial.println();
}
}
I dont know why it's doesn't works. When I changed Uno with Micro and Micro with Uno, it's worked.
But I need: Micro + transmitter FS1000A & Uno + receiver XY-MK-5V.
Please help me. I'm using this Pro Micro.
vw_set_tx_pin(14);
looks a bit odd, if you used that on the UNO. – Gerben Jul 24 at 14:35D14
is connected to the RX LED, and nothing else; it's not broken out to either of the headers so you would never be able to use it to connect to an external component. – CharlieHanson Jul 25 at 12:42