I am trying to get text characters to come up on my I2C LCD. It's a 16x2 display. It only uses four pins: GND, 5V, SCL and SDA. I'm not sure how to program it since all I'm finding online is how to program it if my display had 16 pins. I believe the address for my LCD is 0x27.

link|improve this question
4  
How are we supposed to know what LCD you're talking about? – W5VO Apr 18 at 2:09
feedback

4 Answers

I have a pot connected to my Arduino Uno. This code shows the characters "Voltage=(sensorValue). This way I can turn my pot and my LCD will show how many volts the potentiometer is pushing out.

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);  
void setup()
{
}
void loop()
{
lcd.init();                      
lcd.backlight();
int sensorPin = A0;
int sensorValue = 0;
sensorValue = 0.004882812 * analogRead(sensorPin) + 1;
lcd.print("Voltage=");
lcd.print(sensorValue);
}
link|improve this answer
this site is not like a normal forum, many people would like you to update what LCD you are using, but I assume this means it works with inherent libraries. – Kortuk Apr 19 at 2:47
feedback

You need to use the Arduino I2C libraries: http://www.arduino.cc/en/Reference/Wire

As you said your i2c address is 0x27, is it one of these? http://arduino-info.wikispaces.com/LCD-Blue-I2C

link|improve this answer
Thanks for the website! – Eduardo Apr 19 at 2:41
feedback

For a 4 pin i2c I have used the following page to get it up and running, it was a while ago (and I don't have the hardware/software at this time) http://www.ladyada.net/products/i2cspilcdbackpack/ or if you are just after code the following should work (better) http://forums.adafruit.com/viewtopic.php?f=19&t=21586&p=113177

link|improve this answer
Thanks for the website! – Eduardo Apr 19 at 2:42
feedback

It would be helpful if you posted or linked us to the datasheet for your LCD, There is a LiquidCrystal library which supports the Hitachi HD44780 driver that comes with Arduino see the link below for more information...

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

link|improve this answer
1  
this is not really an answer to the question but instead a link to a LCDs code. Maybe wait until the question is clarified and then answer. – Kortuk Apr 18 at 6:30
Thanks for the website! – Eduardo Apr 19 at 2:41
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.