Pacpat
November 9, 2018, 2:02pm
1
Hello,
i have some trouble with esp32 an HardwareSerial!
here my script for testing the Serial....
#include <HardwareSerial.h>
HardwareSerial Myserial(1);
void setup(){
Serial.begin(9600);
Myserial.begin(9600);
delay(1000);
Myserial.println("Hello World");
Serial.println("Hello World");
}
void loop() {
{
Serialprint run fine It Shoows me pic1
But MyserialPrint shows me some characters.... pic2
I would be glad if someone could help me with this....
Thank
Patrik
What's the baud rate setting in serial monitor?
Pacpat
November 9, 2018, 2:33pm
3
The Serial Monitor has 9600 baut on both (Serial and MySerial)...
darrob
November 9, 2018, 2:37pm
4
Try changing
Myserial.begin(9600);
to
Myserial.begin(9600, SERIAL_8N1, RXD, TXD);[code]
where RXD and TXD are the pins you're using
darrob
November 9, 2018, 2:52pm
6
How do you have it wired up?
Are you using a usb to ttl device?
Provide a schematic/wiring diagram
darrob
November 9, 2018, 3:13pm
8
That looks like a USB to RS-232 device. I don't think it works in the way you're using it.
You need a USB to TTL device, similar to this . or this .
You can find cheaper ones on ebay I'm sure.
Also, for the DUE and the ESP32, I found that a Serial.flush() after the end of a serial print sequence helps rid those funky printer characters.