Serial communication between Arduino UNO & Arduino MKR 1200 FOX

Hello,

I followed this short tutorial Serial Communication Between Two Arduino Boards - Iotguider but the receiver board was an Arduino MKR 1200 FOX.

When I try to display str I get an empty string (=blank) on my computer: the message was not transmitted.

The MKR board has TX and RX so I know this is possible but I don’t find any solution on internet about Serial Communication on this board.

If anyone has an idea I would be grateful

Thank you

You need to post your two programs and a diagram showing how you have everything connected. See this Simple Image Posting Guide

...R
Serial Input Basics - simple reliable non-blocking ways to receive data.

Okay sorry : here is my code and configuration

Sender :

char mystr[5] = "Hello"; //String data

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  Serial.write(mystr,5); //Write the serial data
  delay(1000);
}

Receiver :

char mystr[10]; //Initialized variable to store recieved data

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
}

void loop() {
  Serial.readBytes(mystr,5); //Read the serial data and store in var
  Serial.println(mystr); //Print data on Serial Monitor
  delay(1000);
}

See the pictures for the setup and board configuration

Captureuno.PNG

Capturefox.PNG

Capturefox.PNG

Captureuno.PNG

Please make your images visible in your Post.

This is not going to work for a start

char mystr[5] = "Hello"; //String data

it should be

char mystr[6] = "Hello"; //String data

or

char mystr[] = "Hello"; //String data

so as to create space for the NULL character that terminates a cstring.

And this

Serial.write(mystr,5); //Write the serial data

would be simpler like this

Serial.print(mystr); //Write the serial data

...R

Sorry for the pictures, I'm a newbie

Thanks for answering, I tried what said: the TX led of the UNO (sender) is blinking but nothing appears on the serial screen of COM16 (receiver, MKR board).

pandalisthenics:
Sorry for the pictures, I'm a newbie

Your apology will be accepted with pleasure when you make the images visible.

...R

"If you right-click on the link and then click "Copy image location" you will have the URL for the image. You can paste that to your text editor if you want to look at it, but that is not normally necessary."

I would like but I don't have "copy image location" after a right-click

Perhaps it says "copy link address"

Thanks for pointing that out. I must review the instructions - I think there are two types of message

...R

I have only :
return
moving forward
refresh
save as
print
translate in french
display source code of the page
display source code of the frame
refresh frame
inspect

Nothing to copy a link :confused:

Thank you for your time

This is what I see when I right-click the link at the bottom of your Reply #2

If you see something different on your PC then please post a screenshot

...R

Oh okay, I was doing it wrong, it should be okay now

Thanks for your explanations

If you still have a programming problem have you taken account of what I said in Reply #3?

If so please post the latest version of your program and tell us in detail what it actually does and what you want it to do that is different.

...R