Arduino LCD Shied

Hello;
I am searching for an Arduino LCD shield, but I need also to use at least 2 i/o digital signals of my Arduino board.
What shields do you recommend?
I've had a looked at the arduino shield of dfrobot: Cooking Hacks - Electronic and IoT Kits, tutorials and guides for Makers and Education
Does anybody expierience in this device?
Thanks a lot
Anton

TLERDRDEN:
Hello;
I am searching for an Arduino LCD shield, but I need also to use at least 2 i/o digital signals of my Arduino board.
What shields do you recommend?
I’ve had a looked at the arduino shield of dfrobot: http://www.cooking-hacks.com/index.php/lcd-shield-for-arduino.html
Does anybody expierience in this device?
Thanks a lot
Anton

I have that device, and I’ve used it a few times and it works. Right now, the project I’m working on doesn’t use a screen, so I’ve only done some tests with it. The original version of the shield evidently was mis-wired in that you could not control the brightness, and some vendors had the warning not to use pin 10 at atll. When I bought mine, it had been fixed. Here was my initial post about the screen: http://arduino.cc/forum/index.php/topic,108869.msg817650.html#msg817650

Since then, I’ve learned that it wasn’t a power issue for the servo (though that can be a problem if you use anything by a single low powered hobby servo). The issue is that the Servo library disables PWM on pins 9 and 10 even if you don’t have a servo on those pins, and the LCD wants to use those pins as PWM. So, if you never plan to use a servo, the screen would work.

One thing in using it, I’ve come to the conclusion that 16x2 is a rather small size for doing I/O. Here is a LCD screen I’ve been thinking of that has a 20x4 screen, keypad, buzzer, sensor I/O ports, real time clock + holder for battery, and ability to mount an EEPROM for larger data collection: http://www.ebay.com/itm/221120816817?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649

Here is a sample code that I cobbled together that uses the buttons to control the screen brightness using the LiquidCrystal library:

// Standard output pin assignments
// Pin 0:	serial receive (usb)
// Pin 1:	serial transmit (usb)
// Pin 2:	Interrupt 2 via attachInterrupt
// Pin 3:	Interrupt 3 via attachInterrupt, 8-bit PWM output via analogWrite
// Pin 4:	No special use
// Pin 5:	8-bit PWM output via analogWrite
// Pin 6:	8-bit PWM output via analogWrite
// Pin 7:	No special use
// Pin 8:	No special use
// Pin 9:	8-bit PWM output via analogWrite
// Pin 10:	8-bit PWM output via analogWrite, SPI SS
// Pin 11:	8-bit PWM output via analogWrite, SPI MOSI
// Pin 12:	SPI MISO
// Pin 13:	On board LED, SPI SCK

// Standard input pin assignments
// Pin A0:	No special use
// Pin A1:	No special use
// Pin A2:	No special use
// Pin A3:	No special use
// Pin A4:	TWI SDA pin (Wire library)
// Pin A5:	TWI SCL pin (Wire library)

// LCD shield pin assignments
// Output pin 4, 5, 6, 7, 8, 9 and 10
// Input pin A0.

#include <LiquidCrystal.h> 

// select the pins used on the LCD panel
LiquidCrystal lcd (8, 9, 4, 5, 6, 7);

const int pin_button		= A0;
const int pin_led		= 13;

const int pin_brightness	= 10;
const int max_brightness	= 255;
const int min_brightness	= 1;
const int delta_brightness	= 1;
const int delta_brightness2	= 10;
const int col_brightness	= 11;
const int row_brightness	= 1;
int       cur_brightness	= (min_brightness + max_brightness) / 2;

const int col_header		= 0;
const int row_header		= 0;

const int col_key		= 0;
const int row_key		= 1;

const int delay_key		= 250;
const int delay_debounce	= 50;

const int button_right		= 0;
const int button_up		= 1;
const int button_down		= 2;
const int button_left		= 3;
const int button_select		= 4;
const int button_none		= 5;

static int	     old_key	 = button_none;
static unsigned long prev_millis = 0UL;

// Key message
char msgs[][7] = {
  "Right ", 
  "Up    ", 
  "Down  ", 
  "Left  ", 
  "Select",
};

// adjust the brightness
static void
adjust_brightness (void)
{
  analogWrite (pin_brightness, cur_brightness);

  lcd.setCursor (col_brightness, row_brightness);
  lcd.print (cur_brightness);

  if (cur_brightness < 10)
    lcd.print ("  ");

  else if (cur_brightness < 100)
    lcd.print (" ");
}

// read the buttons
int
read_LCD_buttons (void)
{
  int adc_key_in = analogRead (pin_button);      // read the value from the sensor

  // my buttons when read are centered at these valies: 0, 144, 329, 504, 741
  // we add approx 50 to those values and check to see if we are close
  // We make this the 1st option for speed reasons since it will be the most likely result
 if (adc_key_in > 1000)
   return button_none;

 if (adc_key_in < 50)
   return button_right;

 if (adc_key_in < 195)
   return button_up;

 if (adc_key_in < 380)
   return button_down;

 if (adc_key_in < 555)
   return button_left;

 if (adc_key_in < 790)
   return button_select;

 return button_none;
}

void
setup (void)
{
  pinMode (pin_led, OUTPUT);			// we'll use the debug LED to output a heartbeat
  digitalWrite (pin_led, LOW);

  lcd.begin (16, 2);				// start the library
  lcd.clear ();
  lcd.setCursor (col_header, row_header);
  lcd.print ("Push the buttons");		// print a simple message

  lcd.setCursor (col_key, row_key);
  lcd.print ("<none>");

  pinMode (pin_brightness, OUTPUT);
  adjust_brightness ();
}

void
loop (void)
{
  int key, key2;
  unsigned long cur_millis = millis ();

  key = read_LCD_buttons ();
	
  delay (delay_debounce);			// wait for debounce time
  key2 = read_LCD_buttons ();

  if (key == key2 && (key != old_key || ((cur_millis - prev_millis) >= delay_key)))
    {
      if (key == button_none)
	{
	  digitalWrite (pin_led, LOW);
	  lcd.setCursor (col_key, row_key);
	  lcd.print ("<none>");
	}

      else
	{
	  int prev_brightness = cur_brightness;

	  digitalWrite (pin_led, HIGH);

	  lcd.setCursor (col_key, row_key);
	  lcd.print (msgs[(int)key]);

	  if (key == button_down)
	    cur_brightness -= delta_brightness;

	  else if (key == button_up)
	    cur_brightness += delta_brightness;

	  else if (key == button_select)
	    cur_brightness = (min_brightness + max_brightness) / 2;

	  else if ((key == button_left) && (key == old_key))
	    cur_brightness -= delta_brightness2;

	  else if ((key == button_right) && (key == old_key))
	    cur_brightness += delta_brightness2;

	  if (cur_brightness < min_brightness)
	    cur_brightness = min_brightness;

	  if (cur_brightness > max_brightness)
	    cur_brightness = max_brightness;

	  if (cur_brightness != prev_brightness)
	    adjust_brightness ();
	}

      prev_millis = millis ();
      old_key = key;
    }
}

Here is a LCD screen I've been thinking of that has a 20x4 screen, keypad, buzzer, sensor I/O ports, real time clock + holder for battery, and ability to mount an EEPROM for larger data collection: http://www.ebay.com/itm/221120816817?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649

You may recognize that this shield was designed by one of our regular forum members and that any required support should be readily available.

Don

floresta:

Here is a LCD screen I've been thinking of that has a 20x4 screen, keypad, buzzer, sensor I/O ports, real time clock + holder for battery, and ability to mount an EEPROM for larger data collection: http://www.ebay.com/itm/221120816817?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649

You may recognize that this shield was designed by one of our regular forum members and that any required support should be readily available.

Don

Guilty as charged. :slight_smile:

Very nice!
Thank you all!