UncleBone,
Mem,
The Forum,
Well, one problem at a time: I disconnected the input I had on pin 1, and now I can upload sketchs to the Arduino board easily. Tks for that!
Second: the enable cable was missing: I had only 6 cables connected.
RW pin was connected to earth. Now it is connected to pin 10 on the Arduino board.
Furthermore, I visited the Arduino/Hardware/Code/LCD where there is a clear explanation about using the LCD Library.
Then I entered the link LiquidCrystal - Arduino Reference
It says this:
LiquidCrystal()
Description
Creates a variable of type LiquidCrystal.
Syntax
LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)
Parameters
rs: the number of the Arduino pin that is connected to the RS pin on the LCD
rw: the number of the Arduino pin that is connected to the RW pin on the LCD
enable: the number of the Arduino pin that is connected to the enable pin on the LCD
I followed almost exactly the instructions, only changed the data pins.
Here is the code of my checking routine:
#include <LiquidCrystal.h>
// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// db4, db5, db6, db7 on pins 9, 8, 7, 6
LiquidCrystal lcd(12, 11, 10, 9, 8, 7,6);
int ledPin = 13; // LED connected to digital pin 13
int x; // check variable x
void setup()
{
// Print a message to the LCD.
lcd.setCursor(0,0);
lcd.print("hello, world!");
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
lcd.setCursor(0,1);
lcd.print(x);
x=x+1; // increments x by one
delay(500); // waits 500 milliseconds
digitalWrite(ledPin, LOW); // sets the LED off
delay(500); // waits 500 milliseconds
}
Results:
Now I get nice contrast, nitide figures, no black blocks anymore, but, instead of numbers and letters strange characters are displayed.
Further ideas?