Ciao a tutti, ho comprato il suddetto display da un noto distributore di componentistica italiano. Il problema è che usando lo sketch d' esempio della libreria LiquidCristal (il nome dello sketch è Hello World) non riesco a visualizzare nè "hello world" nè altre informazioni. Semplicemente si creano dei quadrati neri pieni sulla prima riga e vedo altro; i collegamenti sembrano fatti bene.
Vi allego una foto: http://img651.imageshack.us/img651/7799/17072010088.jpg
e il datasheet: http://www.robot-italy.net/downloads/GDM1602K.pdf
Salve, scusami ma non riesco a seguire i fili sulla breadboard, prova a fare un'immagine con fritzing che resta molto più chiaro per tutti.
Comunque sia noto degli errori, ad esempio la resistenza è collegata solo da un'estremità, idem il filo blu sopra il display (riga 64 colonne EF)
Ricontrolla i collegamenti e facci sapere, ciao.
Anzitutto grazie per la risposta e la celerità.
lo schema è questo:
Ho collegato i due connettori che erano scollegati (scusa il gioco di parole), ma l' unica variazione è che ora la "scritta" è fissa, cioè non lampeggia più ogni tot secondi, ma ci sono sempre i quadrati nella prima riga pieni.
Se cambio lo sketch originale in questo modo:
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 25 July 2009
by David A. Mellis
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 rows and columns:
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);
}
Entrambe le righe si colorano di nero.
Tuttavia con lo sketch originale ero riuscito a vedere (giocando con il potenziometro) un cursore ( così: "_") che passava attraverso tutte le "celle" del display.
Un altra cosa, nei commenti del codice dice: "* 10K resistor:" ma dove la dovrei collegare?
Ciao, grazie a tutti, ma ho risolto, era solo un problema di regolazione perfetta del contrasto, a quanto pare basta una rotazione anche "infinitesimale" che salta tutto
Risolto, grazie lo stesso
Ora però ho un altro problema (non fucilatemi lol):
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 25 July 2009
by David A. Mellis
http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/
// include the library code:
#include <LiquidCrystal.h>
#define echoPin 2
#define initPin 3
unsigned long pulseTime=0;
int tempo;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Hey ciao! :D");
Serial.begin(9600);
}
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);
// send the sensor a 10microsecond pulse:
digitalWrite(initPin, HIGH);
delayMicroseconds(10);
digitalWrite(initPin, LOW);
// wait for the pulse to return. The pulse
// goes from low to HIGH to low, so we specify
// that we want a HIGH-going pulse below:
pulseTime = pulseIn(echoPin, HIGH);
tempo=distcm(pulseTime);
Serial.print(tempo);
lcd.print(tempo);
delay(100);
}
long distcm(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}
Premettendo che il codice è preso da parti del playground ed internet, e che non è il mio, chiedo aiuto perchè quando lo vado ad eseguire mi escono dei caratteri "strani" tipo giapponese o giù di lì