Dear forum.
Im trying to setup a old arduino uno r1 as a sensor board collecting data and send sensor data over UART to a uno wifi R4. If I understod correct the Arduino uno r1 serial is shared with pc usb port and rx/tx pins 0 and 1 (?).
So I have the hypothesis the command SoftwareSerial sUART (2, 3); might work together with library #include <SoftwareSerial.h>. It all compiles and uploads to board but I receive no sign of communication between the boards. Baud rate is correct (9600) and i tried switching over rx-tx on gpio pins 2,3...many times. Im too stupid searching this forum for wildcards with "uno r1 uart" but Im sure this problem is described how to solve in several posts. Please be patient and kindly advice as Im stuck.
Code snippet :
if (sUART.available() > 0) {
char inputChar = sUART.read();
if (inputChar == '\n') {
sendMessage = "1";
sUART.println(sendMessage); // Send the message through Serial1 with a newline character
//sendMessage = ""; // Reset the message
} else {
sendMessage += inputChar; // Append characters to the message
}