But when I upload the code string “hello” is sent by the arduino but not received by wio terminal?
Sending code:
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);
}
Receiving Code:
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);
}
JIC, besure to cross the connections, i.e. the TX pin from one goes to the RX pin of the other & you match the baud rate, databit and parity. as well as no flow control.
my.02
HTH
GL
Sorry if this is a trivial question @PJ_Glasso, but how can I make sure that the databit, parity, and flow control match between Arduino Uno and Wio Terminal.
nvm, I tried doing Serial.begin(9600, SERIAL_8N1) on both sending and receiving side but it didn’t work. The wio terminal is still not able to read the “Hello” string sent by the Arduino Uno.
I tested it and it should be fine, the light is blinking when the serial port is sending and receiving. I am using Wio Terminal for sending and UNO for receiving.
I have modified your code, for example the Hello string should be of length 6 (don’t forget the terminator “/0”) and the hardware serial port of the Wio Terminal is Serial1.
It works when I send from the Wio Terminal and receive from the Arduino.
But when I send from the Arduino Uno and receive from the Wio Terminal, the code doesn’t work, I don’t see the “Hello” string received in the Wio Terminal’s Serial Monitor.
// Sender - Arduino Uno
char mystr[6] = "Hello"; //String data
void setup() {
// Begin the Serial at 9600 Baud
Serial.begin(9600);
}
void loop() {
Serial.write(mystr,6); //Write the serial data
delay(1000);
}
// Reciever - Wio Terminal
char mystr[10]; //Initialized variable to store recieved data
void setup() {
// Begin the Serial at 9600 Baud
Serial1.begin(9600);
}
void loop() {
Serial1.readBytes(mystr,6); //Read the serial data and store in var
Serial1.println(mystr); //Print data on Serial Monitor
}
I was able to get the serial communication between Wio Terminal and Arduino working through using an Arduino Mega instead of Arduino Uno. I think this works because the mega has more serial ports (I used Serial1 on both Mega and Wio Terminal).