Simple, stupid Serial question - sorry

High folks. I'm trying to get 2 MKR WiFi 1010s to talk to each other via serial. I have the grounds connected to each other, the TX & RX pins connected TX to RX & RX to TX. I wrote some simple basic test code for one MKR to keep sending a serial string (Serial.print("Hello World")) every 5 seconds and the other MKR is looking for the serial data (Serial.available() > 0). Both MKRs do what is expected if I use the USB connector and Serial Monitor but nada using just the serial TX & RX pins (13 & 14). I initialize with Serial.begin(9600) and I don't get a serial connection (Serial = 0). Please tell me what basic thing I'm missing here? Thanks so much.

Please post all your code (in code tags) and a schematic of your setup.

It might be Serial1 that you need to use

It is Serial1 that is needed.

Serial.begin(9600);
Is for the serial monitor

Serial1.begin(9600);
Is for the serial port on pins 13 and 14.

Excellent. That works, thank you. Just out of curiosity, where do I find things like that documented? I looked all over (including the "Serial main page") and couldn't find this. I saw a note about the 4 ports on a Mega, but that's it. Thanks again.

Ah! I looked at that table a couple of times and never realized that the row on top was literally the serial port name. Thanks man.

void setup() {
  Serial.begin(9600);
}
void loop() {
   Serial.write("Hello World");
    delay(5000);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.