Trensicourt
Active member
I'm trying to send "Hello" from the Master Teensy 4.1 to the Slave Teensy 4.1. However, I am not getting any information from the receiver serial monitor. I have connected TX1 to RX1 and RX1 to TX1 from Teensy to Teensy.
Here's the hardware picture:
The sender (COM5) is outputting "Hello" but the receiver isn't (COM6). I am using two serial ports, one per each Teensy, but with separate applications of the Arduino IDE open.
sender:
receiver:
Here's the hardware picture:
The sender (COM5) is outputting "Hello" but the receiver isn't (COM6). I am using two serial ports, one per each Teensy, but with separate applications of the Arduino IDE open.
sender:
Code:
char Mymessage[6] = "Hello"; //String data
int ledPin = 34;
void setup() {
pinMode(ledPin, OUTPUT);
// Begin the Serial at 9600 Baud
Serial.begin(9600);
}
void loop() {
Serial.write(Mymessage,6); //Write the serial data
digitalWrite(ledPin,HIGH); //set LED ON
delay(1000);
digitalWrite(ledPin,LOW); //set LED ON
delay(1000);
}
receiver:
Code:
char Mymessage[12];
int ledPin = 34;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin,OUTPUT);
//Begin the Serial at 9600 Baud
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.readBytes(Mymessage,6);
//Read the serial data and store in var
digitalWrite(ledPin,HIGH);
Serial.println(Mymessage);
//Print data on Serial Monitor
delay(1000);
}
Last edited: