Using Serial Monitor to Control an LCD Display.

Hi,

I’m running an Arduino Yun connected to an LCD display and have successfully managed over USB to use the Serial Monitor in the IDE to control the LCD’s output.

However, when I swap over to WiFi connection, the serial monitor is unable to connect to the Arduino, I have tried numerous fixes but I can’t seem to successfully make the code work.

Could anybody suggest a quick fix for my code that would enable me to control my LCD over WiFi?

Thanks in advance and apologies if this is a common topic, I’m a newcomer to the world of Arduino!

Here is my current code in full:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
  lcd.begin(16, 2);
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available()) {
    delay(100);
    lcd.clear();
    while (Serial.available() > 0) {
      lcd.write(Serial.read());
    }
  }
}

Works perfectly over USB, alas not so perfectly over WiFi :blush:

Serial.avaiable when serial are not connected?

So normally for debug you use serial.println()

If you want use LCD just change serial.println()
To LCD.write().

Regards,

Marchetto Davide

Hi, I'm using the Serial Monitor as an input so the user can input what they wish for the LCD to display, not as an output.

"Serial" is bound to the usb cable. If you wish to use the "wifi port" (ip address), you need to use "Console". It has the very same functions (begin, print, println, read...)

Okay, so the code now works and I can use the console to input to the LCD, however the LCD is just displaying gibberish.

#include <LiquidCrystal.h>
#include <Console.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
  lcd.begin(16, 2);
  Bridge.begin();
  Console.begin();
}

void loop()
{
  if (Console.available()) {
    delay(100);
    lcd.clear();
    while (Console.available() > 0) {
      lcd.write(Console.read());
    }
  }
}

Final update, console now works however I receive 3 lines (|||) after each message on the LCD display. The problem was the LCD setup had declared the screen as 16x2 and when changing it to two by 16 the previous issue seems to have been fixed.

Suggestions to remove the three lines?

Thanks

Hi jacobisuglyok,

which type of LCD do you use? I tried with SaintSmart 20x4 and I don’t get it successfully running.

Andreas