Hello,
I have a HD44780 display that I am trying to use with my Arduinos. To this end, I have imported the LiquidCrystal.h header as described in http://www.arduino.cc/en/Tutorial/LiquidCrystal, however, the moment I upload a sketch that includes this header, the Arduino appears to lock up. Nothing happens on the screen, and the LED on pin 13 doesn't blink (it stays on continuously) despite the addition of
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
to the loop() function. My conclusion is that there is an unresolved issue with LiquidCrystal.h that causes a lock, or possibly an infinite loop. This happens on both my Mega and on my Nanos (I haven't tested with the Uno, because I can't seem to locate it at the moment). What's your take on this?
For the sake of completeness, here is the code(s) I have tested:
#include <LiquidCrystal.h>;
int led = 13;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup () {
lcd.begin(16, 2);
lcd.print("hello, world");
pinMode(led, OUTPUT);
}
void loop () {
lcd.setCursor(0, 1);
lcd.print(millis()/1000);
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
#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);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}