i have seen r/w pin always connected to ground in all lcd schemas but i want to create a custom char, can this r/w pin be connected to ground or should i connect it to an arduino pin?
THANKS :-[
i have seen r/w pin always connected to ground in all lcd schemas but i want to create a custom char, can this r/w pin be connected to ground or should i connect it to an arduino pin?
THANKS :-[
The R/W pin has nothing to do with creating a custom character. Leaving the R/W pin on ground is fine.
If you want to create a custom character you'll need to do so in the code. It will go something like this. Assuming your using the LiquidCrystal library.
#include <LiquidCrystal.h> // load library for LCD
// designate the pins to run the LCD
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // the pins you use may very
// arrays used to build custom characters
byte UP[8] = // array to make an arrow pointing up
{
B00000,
B00100,
B01110,
B11111,
B00100,
B00100,
B00100,
B00000
};
byte Down[8] = // array to make an arrow pointing down
{
B00000,
B00100,
B00100,
B00100,
B11111,
B01110,
B00100,
B00000
};
void setup()
{
// creates custom characters from the arrays storing them to
// one of 8 (0-7) available custom character slots.
lcd.createChar(0, UP);
lcd.createChar(1, Down);
lcd.begin(16, 2);
lcd.write(0);
lcd.write(1);
}
void loop()
{
}
Thank you so much!
i have another little stupid question, how can i print existing special chars on rom, like arrows or alpha character for example?
That i don't know. As far as i know the Hitachi controller only has 8 available character slots for defining custom characters. I believe the lcd.createChar() is what stores the array to the designated section of the Hitachi controller's memory.
I don't understand allot of what or how the libraries work. But here is the section of the .cpp code from the library that controls the createChar() function.
// Allows us to fill the first 8 CGRAM locations
// with custom characters
void LiquidCrystal::createChar(uint8_t location, uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
command(LCD_SETCGRAMADDR | (location << 3));
for (int i=0; i<8; i++) {
write(charmap[i]);
}
}
Maybe you can make something of that or maybe that answers your question.
i want to know how to display special characters which are on the EEPROM lcd memory such japanese characters or arrows, not cutom ones, they are on the hitachi rom memory.
Thanks
What screen do you have?
I'm pretty sure you are limited to the basic set of Ascii characters. Here is the data sheet on the controller. On page 17 is all the available character the Hitachi controller can produce on an LCD screen.
Here is a little test code i wiped up to run threw and display all the characters one by one. The first line shows the character and the second line shows the value used in the lcd.write() command to display that character.
I'm sure there is a better way to call them up but this is what i use to call a specific character. You could also use lcd.print() to display the special characters.
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
for(int i = 0; i <= 255; i++)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.write(i);
lcd.setCursor(0,1);
lcd.print(i);
delay(1000);
}
}
i want to know how to display special characters which are on the EEPROM lcd memory such japanese characters
That depends on the variant of the Hitachi device you've got, or so the datasheet digimike linked suggests (page 2)
yes, on this datasheet i have seen A00 and A02 characterset but there are some characters i cant put with print(""), for example the ohm symbol but this symbols is at ROM.
i'm sorry but my english is not good.
To get to the characters in the upper part of the ROM, you need to print characters with higher values. E.g., to display the character that shows up in column "1100" on row "0101" on the datasheet, you would use something like:
LCD.print(0xc5, BYTE);
Looks like the '[ch937]' character is only supported on ROM Code: A02 character sheet. So it looks like your controller only supports the A00 set. Mine is the same way.
EDIT:
Correction. I was watching as the characters rolled by with the example i posted earlier. I saw the '[ch937]' character at 244. Don't know how i overlooked it in the A00 set.
lcd.write(244):
Upper left corner of the table is 0 and the lower right is 255. You count it down from top to bottom.
thank you so much!
Is it possible to use the custom number generation for a clock display? and how do I go about it?
Thanks
![]()
What custom number generator are you talking about?