Skip to content

Instantly share code, notes, and snippets.

@ptb
Created December 9, 2012 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ptb/4246417 to your computer and use it in GitHub Desktop.
Save ptb/4246417 to your computer and use it in GitHub Desktop.
How to display like http://i.imgur.com/35Ikw.jpg
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
String one = "Target Temp";
String two = "Current Temp";
byte degreesf[8] = {
0b11000,
0b11000,
0b00111,
0b00100,
0b00111,
0b00100,
0b00100,
0b00000
};
byte degreesc[8] = {
0b11000,
0b11000,
0b00011,
0b00100,
0b00100,
0b00100,
0b00011,
0b00000
};
void setup() {
one.toUpperCase();
two.toUpperCase();
lcd.createChar(0, degreesf);
lcd.createChar(1, degreesc);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(one);
lcd.setCursor(15, 0);
lcd.write((uint8_t)0);
lcd.setCursor(0, 1);
lcd.print(two);
lcd.setCursor(15, 1);
lcd.write((uint8_t)0);
}
void loop() {
lcd.setCursor(13, 0);
lcd.print(72);
lcd.setCursor(13, 1);
lcd.print(68);
}
@ac30rc
Copy link

ac30rc commented Jun 11, 2013

sorry to say but this doesn't work at all. i can't see anything in the lcd. no display.

@ac30rc
Copy link

ac30rc commented Jun 11, 2013

i made the following connections:

lcd arduino uno r3
vss gnd(common gnd via breadboard)
vdd +5v(common via breadboard)
vo potentiometer(wiper pin) 10kOhms
rs 12
rw gnd(common via breadboard)
e 11
d0 no connection
d1 no connection
d2 no connection
d3 no connection
d4 5
d5 4
d6 3
d7 2
a +5v(common via breadboard)
k potentiometer(wiper pin) 10kOhms

I did these connections and then uploaded the sketch to arduino, but i get no display at all. I mean i see the lcd showing all the coloums and rows together, but no characters as it should. This is the problem, i can't get it to work. I tried thousands of other ways, then found yours, but even yours couldn't get it working.

What shall i do now ?

@ac30rc
Copy link

ac30rc commented Jun 11, 2013

Hey thanks it worked, i added a resistor to the 15th pin of lcd, rather than direct +5v. now its getting 4.2v and i have a proper display for the 1st time. Thanks bro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment