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

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