0

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
asked Jul 24, 2015 at 10:21
4
  • What in particular doesn't work? You don't receive any characters? You get a garbage message? Commented Jul 24, 2015 at 11:31
  • And which Pro Micro: the geniune SparkFun Pro Micro - which version (it says on the PCB); the A-Star variant; a cheap chinese copy? Commented Jul 24, 2015 at 11:33
  • Are you connecting the modules to the right pins? vw_set_tx_pin(14); looks a bit odd, if you used that on the UNO. Commented Jul 24, 2015 at 14:35
  • On a Pro Mirco, 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. Commented Jul 25, 2015 at 12:42

1 Answer 1

1

Thanks for your answers. I solved this problem, my Chinese copy has problems with power.

Avamander
6242 gold badges11 silver badges35 bronze badges
answered Jul 26, 2015 at 21:29
2
  • 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. Commented Aug 17, 2015 at 20:31
  • @NickGammon The problem was solved according to feok. This is an answer although it has not been accepted. Commented Aug 17, 2015 at 22:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.