Go Down

Topic: how to get lcd to show soft serial received text ? (Read 398 times) previous topic - next topic

peter1929

Hello All ,programming is not my strength ( electronics is)... I would like to display what i have coming out of my soft serial port so i can see on the lcd... I have been able to type into serial monitor and shows on lcd, but how to show what is coming out of soft serial seems to avoid me...

I want to make a small device that i can send a command ( text or number to my Bluetooth on the uno and be able to check what it receives on the lcd, works ok at present i can monitor on the serial monitor , just want to add lcd so was portable.... My code below ( I bet it is something very easy I am just missing) ?

Code: [Select]
Quote



#include <SoftwareSerial.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

SoftwareSerial mySerial(3, 2); // RX, TX
#define text
#define text=myserial

void setup() 
{

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);//added
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  mySerial.begin(115200);
  mySerial.println("test comms");
}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
  delay(100);
  lcd.clear();
  lcd.print("need to see what bluetooth received ");// this is where i would like to send soft serial so i can see it on the lcd ???
}




johnwasser

Instead of writing to Serial, try writing to lcd:
Code: [Select]

  if (mySerial.available())
    lcd.write(mySerial.read());
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

peter1929

Thanks Karma,,,, I needed to add a delay also so could see the display..
Cheers.

Go Up