hi,
I have this http://www.adafruit.com/products/198 lcd with the i2c backpack and I want to draw pixel size bars, can I do that with the liquidcrystal library ?
thanks
20x4 lcd pixel draw
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
Depending on how you want these bars to look, you can sort-of do it. You'll have to print the bars as character sequences. See the datasheet (page 17,18) for the complete character set.
If none of those characters will work for you, you can define your own characters in "character generator RAM" on the HD44780 chip. See page 13 of the datasheet:
If none of those characters will work for you, you can define your own characters in "character generator RAM" on the HD44780 chip. See page 13 of the datasheet:
In the character generator RAM, the user can rewrite character patterns by program. For 5 × 8 dots, eight character patterns can be written, and for 5 × 10 dots, four character patterns can be written.
- timi
- Posts: 29
- Joined: Tue Jan 10, 2012 10:35 am
Re: 20x4 lcd pixel draw
I am trying to test this code but it just prints some scrambled pixels
can someone give me a little help with the right code ?:(
thanks
can someone give me a little help with the right code ?:(
Code: Select all
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(0);
byte test[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};
void setup() {
lcd.createChar(1, test);
lcd.begin(20, 4);
lcd.write(1);
}
void loop(){}
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
Does the display work otherwise? What happens if you do lcd.write('a'); instead of lcd.write(1)? Do you see the 'a' correctly?
If so, try moving the call to createChar to after the begin:
If so, try moving the call to createChar to after the begin:
Code: Select all
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(0);
byte test[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};
void setup() {
lcd.begin(20, 4);
lcd.createChar(1, test);
lcd.write(1);
}
void loop(){}
- timi
- Posts: 29
- Joined: Tue Jan 10, 2012 10:35 am
Re: 20x4 lcd pixel draw
sure the display works without problems so far and it prints a with lcd.write('a');
here here is a photo of the char displayed with lcd.write(1);
and the lcd.write('a');
here here is a photo of the char displayed with lcd.write(1);
and the lcd.write('a');
- timi
- Posts: 29
- Joined: Tue Jan 10, 2012 10:35 am
Re: 20x4 lcd pixel draw
PS: I am using your liquidcrystal library for i2c backpack
thanks
thanks
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
Did you try changing the code as I suggested?
- timi
- Posts: 29
- Joined: Tue Jan 10, 2012 10:35 am
Re: 20x4 lcd pixel draw
yes I did, and it prints "a" on lcd
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
No - I meant changing the order of the code in setup(). Moving the call to createChar() to after the call to begin(). See my earlier post..
Code: Select all
void setup() {
lcd.begin(20, 4);
lcd.createChar(1, test);
lcd.write(1);
}
- timi
- Posts: 29
- Joined: Tue Jan 10, 2012 10:35 am
Re: 20x4 lcd pixel draw
awesome, it works, newbie mistake:( also need to set setCursor() or else nothing shows up
-
- Posts: 3
- Joined: Tue Feb 12, 2013 9:14 am
HD44780 simply what's it's size in centimeters?
Hello
I am just trying to find out what is the size of this HD44780 (inches or cm or whatever! : ) )
Somehow I have not found it on data sheets. :/
Thank you, sorry for really simple question
I am just trying to find out what is the size of this HD44780 (inches or cm or whatever! : ) )
Somehow I have not found it on data sheets. :/
Thank you, sorry for really simple question
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
The HD44780 is a driver chip common to many different character LCD displays. Are you interested in the dimensions of the chip, or in the dimensions of a particular display?
Display dimensions are available on our product pages. The dimensions for this 20x4 display are available from the data sheet linked to on the product page.
Display dimensions are available on our product pages. The dimensions for this 20x4 display are available from the data sheet linked to on the product page.
-
- Posts: 3
- Joined: Tue Feb 12, 2013 9:14 am
Re: 20x4 lcd pixel draw
Oh, sorry I gave the wrong ID. I meant the display itself. Yes I found the data sheet of the product " Standard LCD 20x4 + extras - white on blue ID: 198" . Unfortunately having read the 18 pages and searching for the dimensions in cm or inches of the display, I did not find the size of the display that gives 20 characters wide, 4 rows. I do not have it in hand, so I cannot imagine the size or height of characters. Is the display where the characters are > than 10cm wide?
Thank you for your response.
Thank you for your response.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 20x4 lcd pixel draw
Every possible dimension except the designer's shoe size is in the diagram on page 4 of the datasheet.
-
- Posts: 3
- Joined: Tue Feb 12, 2013 9:14 am
Re: 20x4 lcd pixel draw
ahhh! right!! thanks!! so when I read 70,4 x 20,8 (for the black grid) it must be milimeters i guess.
Please be positive and constructive with your questions and comments.