Pages: [1]   Go Down
Author Topic: How to print special charactrers © ® ² "TM" in LCD display?  (Read 1278 times)
0 Members and 1 Guest are viewing this topic.
INDIA
Offline Offline
Newbie
*
Karma: 0
Posts: 3
curious!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

........Hola Arduino fans smiley-cool
For the following special characters,
© - Copyright
® - Registered
TM - Trade Mark
² - Square (Eg: X²) or power 2

what are the character codes?
I have a HD44780U LCD Display with ROM Code: A00.
For the above mentioned characters, there appears to be no code in the datasheet provided.
But for ROM Code: A02, the codes are 169 for (c) & 174 for (R). But for others, there is no code.
Any idea on how to make them appear on the display???
Logged

[E=mc²]©®™

France
Offline Offline
God Member
*****
Karma: 34
Posts: 987
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While I don't have an LCD display like yours, I believe it's the same principle for all kind of Arduino displays: you have to create those characters yourself with an array of bytes. Look the file "font.h" (I suppose) to see how each characters are defined. Include the font file in your reply here and I might help you make a character smiley
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But for ROM Code: A02, the codes are 169 for (c) & 174 for (R).
I've never seen a datasheet with the codes expressed in decimal.  I have no idea where to look on the Character Code chart to see if you are correct.

Quote
But for ROM Code: A02, the codes are 169 for (c) & 174 for (R). But for others, there is no code.
Any idea on how to make them appear on the display???
If you have a display that has actual IC chips on the back (instead of epoxy blobs) you can look at the part number on the controller chip.  Mine is HD44780A00.  Assuming that your analysis of the Character Code chart is correct you would need one one with an HD44780A02 controller chip in order to get those characters.  Good luck.

Don
« Last Edit: December 06, 2012, 10:48:20 am by floresta » Logged

INDIA
Offline Offline
Newbie
*
Karma: 0
Posts: 3
curious!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys, its done...


Code:
#include  <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// ^2
byte newCharSquare[8] = {
  B01100,
  B10010,
  B00100,
  B01000,
  B11110,
  B00000,
  B00000,
  B00000
};
 
// (C)
byte newCharCopyright[8] = {
  B11111,
  B10001,
  B10101,
  B10111,
  B10101,
  B10001,
  B11111,
  B00000
};
 
// (R)
byte newCharRegistered[8] = {
  B11111,
  B10001,
  B10101,
  B10001,
  B10011,
  B10101,
  B11111,
  B00000
};
 
// TM
byte newCharTrademark[8] = {
  B01110,
  B00100,
  B00100,
  B00000,
  B01010,
  B10101,
  B10101,
  B00000
};
 
int i = 0;
 
void setup()
{
  lcd.createChar(0, newCharSquare);
  lcd.createChar(1, newCharCopyright);
  lcd.createChar(2, newCharRegistered);
  lcd.createChar(3, newCharTrademark);
  lcd.begin(16, 2);
 
  for(int n = 0; n < 4; n++)
  {
    lcd.setCursor(n,0);
    lcd.write(n);
  }
}
 
void loop()
{
 
}
« Last Edit: February 03, 2013, 10:30:49 pm by arjunoids » Logged

[E=mc²]©®™

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Better give them meaningful names
* newChar1 => newCharSquared
* newChar2 => newCharCopyRight
* newChar3 => newChar???
* newChar4 => newCharTRadeMark

easier to remember smiley
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

INDIA
Offline Offline
Newbie
*
Karma: 0
Posts: 3
curious!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Better give them meaningful names
* newChar1 => newCharSquared
* newChar2 => newCharCopyRight
* newChar3 => newChar???
* newChar4 => newCharTRadeMark

easier to remember smiley


thanks for the tip.... keeps us organized. I have modified the code accordingly.
Logged

[E=mc²]©®™

Pages: [1]   Go Up
Jump to: