Hello, I would like to use a program which would allow me to send a message of my transmitter(issuer) has my receiver via my 2 cards(maps) arduino.
I have to try several program but none works, nevertheless the connection of my receiver and broadcasting seems to me correct (GND, 5v, Port 12/11), and the compilation and the téléversement are well also, I would need a simple program to send a message as "hello" which I could read on the serial monitor of my receiver, I begin on arduino and thus does not know very well the coding on this one.
Didn't you just post this in French?
Where is your code?
This is my code of my emitter:
#include <VirtualWire.h>
const char *msg = "Hello";
void setup()
{
Serial.begin(9600);
Serial.println("Communication on");
vw_setup(2000);
}
void loop()
{
Serial.print("send...");
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx();
Serial.println("Done !");
delay(1000);
}
and this is my code of my Receiver:
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600); nitor
Serial.println("Communication on");
vw_setup(2000);
vw_rx_start();
}
void loop()
{
uint8_t msgRecu[VW_MAX_MESSAGE_LEN];
uint8_t longueurMsg = VW_MAX_MESSAGE_LEN;
if (vw_wait_rx_max(200))
{
if (vw_get_message(msgRecu, &longueurMsg))
{
Serial.print("I receive : ");
for (byte i = 0; i < longueurMsg; i++)
Serial.print(msgRecu*);*
- Serial.println("");*
- }*
- }*
}
I'd forget about VirtualWire, and first prove that your radios are working as you expect - start with something simple, like lighting a LED when you receive something.
Also, it makes it easier to read your code if you use code tags
Yeah, but i just need to send a message of my emitter has my receiver. And i know that my emitter works because i can receive " Comunnication on" and "send....Done!" but i can"t receive "hello" in my serial monitor and i don't know what change in my code.
When I just test my emitter, the serial monitor display :
" Comunnication on
Send... Done! "
And when I just test my receiver, the serial monitor display:
" Comunnication on "
When I decide to use both programs with their arduino connected to the computer the result is the same and no message displays.
Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.
Thread locked.
Other thread: Emetteur/Recepteur - Français - Arduino Forum