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.
CharlieHanson
1,4301 gold badge11 silver badges25 bronze badges
1 Answer 1
Thanks for your answers. I solved this problem, my Chinese copy has problems with power.
Avamander
6242 gold badges11 silver badges35 bronze badges
-
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question.2015年08月17日 20:31:05 +00:00Commented Aug 17, 2015 at 20:31
-
@NickGammon The problem was solved according to feok. This is an answer although it has not been accepted.Avamander– Avamander2015年08月17日 22:55:50 +00:00Commented Aug 17, 2015 at 22:55
lang-cpp
vw_set_tx_pin(14);
looks a bit odd, if you used that on the UNO.D14
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.