Pages: [1]   Go Down
Author Topic: (allmost )improved Serial To LCD  (Read 290 times)
0 Members and 1 Guest are viewing this topic.
Maastricht, Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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);        
        }
      }
    }
  }
}

Logged

Pages: [1]   Go Up
Jump to: