Bueno el tema que deberia ser el mas sencillo se complica;
Tengo esta pantalla LCD 16 x 02 y su adaptador IC2
COSAS QUE YA INTENTE;
Usar la libreria (o conjunto de librerias mas recomendado)
Cambiar los Pines de acuerdo con la hoja del fabricante
Corri el sketch para encontrar la direccion del LCD (0x27, aunque el documento decia 0x20)
Ver ejemplos en el arduino.cc (la mayoria funcionaron con el primer ejemplo que pego aqui)
Algo se me escapa y en esto si estoy realmente perdido... agradecia ayuda!
Lo unico que no he intentado es quitar la libreria original de LCD pero al parecer esta libreria es un conjunto de librerias, y utliza algunas de sus funciones. Pero con gusto lo intento... alguien sabe donde estan las que vienen con arduino? yo solo veo las que le he agregado yo??
Modelo display; QC1602A V.2.0
Modelo del adaptador ; -No disponible les dejo lo que dice el fabricante-
Adaptador IC2
Primero lo primero; Escanear para ver que el IC2 este funcionando;
Codigo del escaner;
// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011
#include <Wire.h>
void setup() {
Serial.begin (115200);
// Leonardo: wait for serial port to connect
while (!Serial)
{
}
Serial.println ();
Serial.println ("I2C scanner. Scanning ...");
byte count = 0;
Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Found address: ");
Serial.print (i, DEC);
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
count++;
delay (1); // maybe unneeded?
} // end of good response
} // end of for loop
Serial.println ("Done.");
Serial.print ("Found ");
Serial.print (count, DEC);
Serial.println (" device(s).");
} // end of setup
void loop() {}
Resultado;
I2C scanner. Scanning ...
Found address: 39 (0x27)
Done.
Found 1 device(s).
Me instale la libreria V1.21 (La mas nueva de malpartida)
Me voy a sus ejemplos, hago el hello world.. En la seccion de IC2
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define BACKLIGHT_PIN 13
LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address
LCD *myLCD = &lcd;
void setup()
{
// Switch on the backlight
pinMode ( BACKLIGHT_PIN, OUTPUT );
digitalWrite ( BACKLIGHT_PIN, HIGH );
myLcd->begin(16,2); // initialize the lcd
myLcd->home (); // go home
myLcd->print("Hello, ARDUINO ");
myLcd->setCursor ( 0, 1 ); // go to the next line
myLcd->print (" WORLD! ");
}
void loop()
{
}
No funciona, ahora bien... me noto que en el ejemplo no usan este pedacito de codigo que por lo que he leido es original de liquid cristal y sirve para poner los pines adecuados...
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 6, 5, 4, 11,12,13,14,16, NEGATIVE); // Set the LCD I2C address
Esta linea de codigo la saque de Este link
Muy bien, lo agrego.... voy a mi hoja de datos del fabricante y me dice lo siguiente;
PINES DISPLAY
6-Enable
5-R/W
4- RS
11-db4 //el codigo dice d4...
12-db5
13-db6
14-db7
16-K (power supply for B/L(0V)
Ahora bien... La pantalla una vez que se carga el codigo se apaga...
Si despego el USB se enciende el backligth y luego se apaga... quizas un corto circuito?
Ya intente cambiar el valor del voltaje del backligth... negative y positive... y lo mismo
PINES ADAPTADOR IC2
Adap / Arduino
GND- gnd
VCC -VCC
SDA -A4
SCL -A5
Intente tambien este codigo de aqui La misma pantalla
Que es algo que me quedo así;
/* YourDuino.com Example Software Sketch
16 character 2 line I2C Display
NEW TYPE Marked "Arduino-IIC-LCD GY-LCD-V1"
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h> // F Malpartida's NewLiquidCrystal library
/*-----( Declare Constants )-----*/
#define I2C_ADDR 0x27 // Define I2C Address for the PCF8574A
//---(Following are the PCF8574 pin assignments to LCD connections )----
// This are different than earlier/different I2C LCD displays
#define BACKLIGHT_PIN 16
#define En_pin 6
#define Rw_pin 5
#define Rs_pin 4
#define D4_pin 11
#define D5_pin 12
#define D6_pin 13
#define D7_pin 14
#define LED_OFF 0
#define LED_ON 1
/*-----( Declare objects )-----*/
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup() /*----( SETUP: RUNS ONCE )----*/
{
lcd.begin (16,2); // initialize the lcd
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,NEGATIVE);
lcd.setBacklight(LED_ON);
}// END Setup
void loop() /*----( LOOP: RUNS OVER AND OVER AGAIN )----*/
{
// Reset the display
lcd.clear();
delay(1000);
lcd.home();
// Print our characters on the LCD
lcd.backlight(); //Backlight ON if under program control
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1); //Start at character 0 on line 1
lcd.print("16 by 2 Display");
delay(8000);
} // END Loop
Ya modificado a mis pines... pero nada...
En teoria esto deberia ser sencillo... no cabe duda que uno aprende algo nuevo todos los dias.
Muchas gracias de antemano...