Hi,
I'm a new user in here - and pretty new to the arduino environment. I am pretty used to building modules in Max/MSP and I want this 16x2 LCD display to show me what I am doing in Max. It all works fine so far, the LCD and the arduino is working and the serial object in max is succesfully converting symbols to ASCII and sending via the serial port.
But I am having trouble with breaking the line and sending symbols to the second line on the display - the bottom line.
I am using the following code on the chip:
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(){
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(38400);
}
void loop()
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(10);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}