Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to get text characters to come up on my liquid crystal lcd screen. it's a 16x2 screen. It only uses four pins...gnd, 5v, scl, and sda pins. I'm not sure what how to program it since all I'm finding online is how to program it if my screen has 16 pins to connect for programming. I believe the address for my lcd screen is 0x27.

Thanks, Eduardo

it's the Arduino Uno. I'm trying to get my LCD to display "Voltage= (variable)". I can write text now. I have a pot wired to my arduino. I'm want to get a voltage number to come after equals sign. How can I program it so when I turn the pot that the actual voltage will come after "Voltage="?

Here's my program

#include <Wire.h> 
#include <LiquidCrystal_I2C.h> 
LiquidCrystal_I2C lcd(0x27,16,2); 
void setup() 
{ 
lcd.init(); 
lcd.backlight(); 
int sensorPin = A0; 
int sensorValue = 0; 
sensorValue = analogRead(sensorPin); 
lcd.print(("Voltage=") + analogRead(sensorPin)); 
} 
void loop() { } 
share|improve this question

closed as off topic by sblair, techie007, random Apr 19 '12 at 16:15

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
i2c devices are supposed to be fairly standard. Have you got your circuit right for i2c? robot-electronics.co.uk/acatalog/I2C_Tutorial.html –  Paul Apr 18 '12 at 9:31
    
it's the Arduino Uno. I'm trying to get my LCD to display "Voltage= (variable)". I can write text now. I have a pot wired to my arduino. I'm want to get a voltage number to come after equals sign. How can I program it so when I turn the pot that the actual voltage will come after "Voltage="? –  Eduardo Apr 19 '12 at 0:11
    
Here's my program #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); void setup() { lcd.init(); // initialize the lcd lcd.backlight(); int sensorPin = A0; int sensorValue = 0; sensorValue = digitalRead(sensorPin); lcd.print(("Voltage=") + digitalRead(sensorPin)); } void loop() { } –  Eduardo Apr 19 '12 at 0:15
    
please edit your question if it has changed, please include any additional information in the question itself. –  Paul Apr 19 '12 at 0:32
    
Sorry about that, Paul. I'm new to the forum and didn't know I had the ability to edit. Thanks! –  Eduardo Apr 19 '12 at 0:41
add comment

1 Answer

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);
}
share|improve this answer
add comment

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