Go Down

Topic: (allmost )improved Serial To LCD (Read 338 times) previous topic - next topic

Junke1990

hey guys I made a change to the Serial To LCD code so if it gets messages it will continue on the line bellow.

BUT!, After the message is done the screen fills up with black boxes...

Code: [Select]
#include <LiquidCrystal.h>

// CONFIG //
int RS = 12;                  
int ENABLE = 11;
int d4 = 6;      
int d5 = 7;      
int d6 = 8;      
int d7 = 9;      
const int numRows = 2;
const int numCols = 16;

int i;
int thisrow;
LiquidCrystal lcd(RS, ENABLE, d4, d5, d6, d7);

void setup()
{
 lcd.begin(numRows, numCols);
 Serial.begin(9600);
}

void loop()
{
 if (Serial.available()) {
   delay(100);
   lcd.clear();
   while (Serial.available() > 0) {
     for (int thisCol = 0; thisCol < numRows; thisCol++) {
       for (int thisRow = 0; thisRow < numCols; thisRow++) {
         lcd.setCursor(thisRow,thisCol);
         lcd.print(Serial.read(), BYTE);
         delay(200);        
       }
     }
   }
 }
}


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy