Created
December 9, 2012 18:35
-
-
Save ptb/4246417 to your computer and use it in GitHub Desktop.
How to display like http://i.imgur.com/35Ikw.jpg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.