Hi guys, im sorry for dropping in like this, im having a problem figuring out how to send a full line into LCD display, the current code i have only writes 1 char at once, actually i tried changing it to loop through every 16 position and write each letter, however it fades the previous letter and then writes the next, i wanted to display every word i typed for as long as the LCD can write it.
Clear the LCD line, set the cursor position to the beginning of the line and set a counter to zero
When a character becomes available then read it and print it to the LCD and increment the counter.
Keep reading from Serial when a character is available and writing to the LCD.
When the counter reaches 16 stop reading Serial and wait a while
Start the process again
Note that the C# program sending the data must not close the serial connection or the Arduino will be reset.
Can you please add that image as an attachment, per forum guidelines? Most people won't follow offsite links, especially when you don't bother to mark them with a URL tag.
aarg:
Can you please add that image as an attachment, per forum guidelines? Most people won't follow offsite links, especially when you don't bother to mark them with a URL tag.
Awesome, exactly what i wanted. I just made some fixes since Serial.read() was sending text into bytes(numbers) to the lcd screen, all i did was store the reading into a char variable and works just as intended, thanks a lot!!!!!!!!!!!
here's the whole code
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int counter = 0;
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
lcd.setCursor(0, 0);
}
void loop()
{
if (Serial.available()) //only read when a character is available
{
char c = Serial.read();
Serial.write(c);
lcd.print(c);
counter++;
}
if (counter == 16)
{
delay(5000);
lcd.setCursor(0, 0);
lcd.print(" ");
counter = 0;
lcd.setCursor(0, 0);
}
}
// CREDITS TO UKHeliBob