WOuld you please help me with an example how to make the two cores of Arduino Giga Wifi talk to ach other as I aim to connect two sensors on M4 cores and another 2 on M7 cores. I would like to serial print all sensors data by M7. So, how can I send the M4 sensors reading data to M7.
I appreciate your support.
I tried to folow instruction from the officail website but it did not work well.
https://docs.arduino.cc/tutorials/giga-r1-wifi/giga-dual-core/
I tried this to test the code:
1- To write from M4 to M7
int x=0;
int y=0;
#include <RPC.h>
void setup() {
// put your setup code here, to run once:
RPC.begin();
}
void loop() {
// put your main code here, to run repeatedly:
x++;
y=y+10
RPC.write(x);
RPC.write(y);
}
2- To read from M4 by M7
#include <RPC.h>
int x = 0; // Variable to store the received value
void setup() {
Serial.begin(9600); // Start the serial communication
while (!Serial); // Wait for serial port to connect. Needed for native USB port only
// Initialize the RPC communication
RPC.begin();
}
void loop() {
// Check if there is any data available from Core M4
if (RPC.available()) {
// Read the data sent from Core M4
x = RPC.read();
y = RPC.read();
// Print the value of x
Serial.println(x);
Serial.println(y);
}
}
The result was mix of both x and y, not individual.