Pages: [1]   Go Down
Author Topic: how to get lcd to show soft serial received text ?  (Read 383 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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 ???
}


Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8854
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Instead of writing to Serial, try writing to lcd:
Code:
  if (mySerial.available())
    lcd.write(mySerial.read());
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: