Sending data from uno to due using hc05 wirelessly

I have successfully connected my uno with hc05 and due with hc05 too and have paired them using AT+LINK Both the hc05 have started blinking together now i want to transfer data from uno to due I have connected a microphone with uno and here is the receiver code of uno :

#include <SoftwareSerial.h>
#define rxPin 11
#define txPin 10
SoftwareSerial myserial= SoftwareSerial(rxPin,txPin);
int analogpin=0;
void setup(){
  Serial.begin(9600);
  myserial.begin(9600);
}
void loop(){
 
 
    int b=analogRead(analogpin);
     Serial.println(b);
     delay(1000);
     myserial.write(b);
     
    
}

And on due i have used this code

void setup()
{ 
Serial.begin(9600);
Serial1.begin(9600);
)
void loop()
{
int a=Serial1.read();
Serial.println(a);
}

But the data appearing on the serial monitor of uno is not going on due .
Can you please help its urgent

You have not supplied what you actually get, if anything. This may assist in our answers.

Weedpharma

It is a good idea to decide the process for receiving data first as it is generally easier to make the transmitter match the receiver than vice-versa.

I would recommend the technique in the third example in serial input basics. It is simple and reliable and non-blocking.

…R

i am getting numbers between 0 to 1024 and they are continuously changing as i speak in the microphone.

Hi The problem you have is that you do not know what you are putting into the UNO, so have no way of telling if the data received by the DUE is valid.

You need to at the moment forget the microphone. Connect a 10K potentiometer, one end of the track to UNO Gnd, the other end of the track to UNO 5V. The wiper to the UNO analog input. Then monitor your output and see if you get sweeps from 0 to 1023, as you turn the pot back and forward.

Tom.... :)

Aiman-Farid: i am getting numbers between 0 to 1024 and they are continuously changing as i speak in the microphone.

You still need a reliable protocol for sending the numbers.

Can you print the numbers to the Serial Monitor from the Uno so that you know the values that should appear on the Due ?

...R

i have connected a potentiometer and yes it is giving me numbers between 0 to 1023 and i have print that on my serial monitor of uno

One more thing that i tried is i switch the connection of receiver and transmitter pins of uno ,i connect rx with pin 12 and transmitter with pin 11 now there are some integers data appearing on serial monitor of due but they are not same as uno. Also there is one problem, on both the boards the tx light is blinking but i think on due rx should blink. And last thing i put some delay in the code of uno and when i upload it the data on the due which is not correct, appear with same delay it means both the boards are communicating but the data is not transmitting correctly. I am so stuck :confused:

I did it thank you for your time :)