Display LCD 16×2 con Arduino

Siguiendo con los ejemplos de Arduino, pude seguir este tutorial para soldar LCD a conectores (Header) para poder conectarlo a la protoboard.

http://web.cecs.pdx.edu/~gerry/class/EAS199B/howto/LCDwiring/panel_prep.html

Así lo preparé para soldar:

LCD 16x2 listo para soldar
LCD 16×2 listo para soldar

Este es el equipo para soldar:

Equipo para Soldar
Equipo para Soldar

Así quedó:

LCD 16x2 con Headers Soldados
LCD 16×2 con Headers Soldados

A continuación armé un circuito con el LCD en el Protoboard basado en el circuito siguiente sacado de
http://robocodes.guiskas.com/2010/05/practica1-lcd-con-ldr/

LCD LDR Arduino Circuit
LCD LDR Arduino Circuit

Las siguientes son las modificaciones al circuito:

  • Coloqué un resistor de 10 k ohm en el pin 15 para bajar un poco el backlight que era muy fuerte
  • El LDR en Analog IN 0 y el botón en Digital IN 2 no los conecté todavía

Cargué primero un esquema (programa) con el ejemplo “Hello World” y anduvo, asi que despues cargué el siguiente modificado en base al ejemplo “Scroll” cambiando el texto por “blog.nivel7.com.ar” y el delay del desplazamiento de 150 a 250:

/*
LiquidCrystal Library - scrollDisplayLeft() and scrollDisplayRight()

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 uses the
scrollDisplayLeft() and scrollDisplayRight() methods to scroll
the text.

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
* LCD R/W pin to ground
* 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 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

// include the library code:
#include

// 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("blog.nivel7.com.ar");
delay(1000);
}

void loop() {
// scroll 13 positions (string length) to the left
// to move it offscreen left:
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(250);
}

// scroll 29 positions (string length + display length) to the right
// to move it offscreen right:
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
// scroll one position right:
lcd.scrollDisplayRight();
// wait a bit:
delay(250);
}

// scroll 16 positions (display length + string length) to the left
// to move it back to center:
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(250);
}

// delay at the end of the full loop:
delay(1000);


}

Y estos son los resultados:

LCD con Arduino, Ejemplo Hello World
LCD con Arduino, Ejemplo Hello World
Arduino con LCD 16x2
Arduino con LCD 16×2

 

Resultado en video:

Video de Hello World para móviles o embebido:

Video de scroll blog.nivel7.com.ar o embebido:


Posted

in

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.