This will print an empty line on Serial2; the value that you assign to ch is the number of bytes that were sent (2 bytes, carriage return and linefeed).
You write that value to Serial (the serial monitor?); what do you see? And to the LCD; what do you see?
If Serial2 is your doppler sensor, I guess that you wanted to do a read() instead of a println().
You will have to provide the details (datasheet) of the sensor that you're using if you get stuck further down the line.
Serial Monitor works fine showing the correct information " V-002.2" 11 times a second if something is detected showing a new line each time
V+001.8
V+001.7
V+001.1
V+001.6
V+001.6
V+001.3
V+000.9
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define RXD2 16
#define TXD2 17
#define SDA 21 //Define SDA pins
#define SCL 22 //Define SCL pins
boolean newData = false;
char receivedChar;
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
char c;
String readString;
void setup() {
// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial2.println("serial2test");
Serial.println("Serial Txd is on pin: " + String(TX));
Serial.println("Serial Rxd is on pin: " + String(RX));
Wire.begin(SDA, SCL); // attach the IIC pin
lcd = LiquidCrystal_I2C(0x27,16,2);
lcd.init(); // LCD driver initialization
lcd.backlight(); // Open the backlight
}
void loop() {
char ch=Serial2.read();
Serial.write(ch);
Serial.println(ch);
lcd.setCursor(1,0);
lcd.print(ch);
}
Currently this with no change. i looked at the serial intro and not sure how to make it effect my issue I can get serial monitor to display the output from doppler and can get the lcd to print data like a countdown or what ever but not sure how to get the link
do I need to float the serial 2 data or something ? like I say coooommmmplete noob at this
Also who else hates these firebeetles . the amount of times i have to press the reset button during upload so it unlocks and accepts code makes me want to throw it out the window
did you try reading a line of text into an array and display as sample code in post 7?
here is a complete ESP32 test program which receives data on Serial2 from an FTDI USB-TTL-3v3 cable connected to a PC - text entered on PC terminal emulator is transmitted to the ESP32
// ESP32 20*4 Blue LCD - display text from Serial2
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display
// Serial2 pins
#define RXD2 16
#define TXD2 17
void setup() {
Serial.begin(115200);
delay(3000);
Serial.println("\n\nESP32 LCD Serial2 test");
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); // initialise Serial2
lcd.init(); // initialize the lcd
lcd.backlight(); // backlight on
lcd.setCursor(0, 0);
lcd.print("ESP32 Serial2 test1");
}
void loop() {
// if Serial2 data read and display on LCD
if (Serial2.available()) {
char data[20] = { 0 }; // read data
Serial2.readBytesUntil('\n', data, 20);
Serial.println(data);
lcd.clear(); // clear the screen
lcd.setCursor(0, 0);
lcd.print(data); // display data on LCD
}
}
Refer to post #4 "Serial Monitor works fine showing the correct information " V-002.2" 11 times a second if something is detected showing a new line each time"
Not sure how the the data sheet will help there is no info about serial