Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Help with custom characters

General discussion about LCD Smartie.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351

Post Reply
twhyman
Posts: 19
Joined: October 20th, 2006, 8:10 am

Post by twhyman »

limbo wrote:There are 8 custom characters on each lcd
The custom character command is changing every time it called one of them e.g. $CustomChar(7,4,4,4,4,4,4,4,0) [will change the 7th]
to display this character to lcd you have to call the location stored in the lcd display $Chr(135)




To use the characters:
for 1 use $Chr(176)
for 2 use $Chr(158)
for 3 use $Chr(131)
for 4 use $Chr(132)
for 5 use $Chr(133)
for 6 use $Chr(134)
for 7 use $Chr(135)
for 8 use $Chr(136)



For more goto http://lcdsmartie.sourceforge.net/commands.html
sorry for quoting an old post but i just cant figure out the meaning of this :oops:

somtimes when i use 2 different custom chars i can see only one is the Chr(xxx) got to do with it?

thanks
limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Post by limbo »

yes, you have to create a different custom character and call it
e.g.
$CustomChar(1,0,15,15,9,11,27,24,0)$Chr(176)
$CustomChar(2,0,17,10,4,31,17,17,31)$Chr(158)
mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

There are 8 "slots" for custom characters in most LCDs, so you can display up to 8 different user-defined characters at a time.

In the $CustomChar command they are labelled 1-8, which makes sense. However, Smartie refers to them using a seemingly random selection of spare or little-used character codes (for various historical/technical reasons).

To use a custom character, you must first define the pixel pattern for that character on the same Smartie screen. To define a custom character, you use (for example, to define 1st custom char as a vertical line) $$CustomChar(1,4,4,4,4,4,4,4,0).

Then, to use that custom char you put the appropriate character code - $Chr(176) for the example above.

If you want to use 2 or more custom characters on the same screen, you must use a different character "slot" for each one, and define each character pattern. As soon as you redefine a particular custom character (say the 1st one - $Chr(176)), any instances of that character on the screen change to the new pattern.

This is supposed to display two vertical bars - a thin one then a fat one - but won't work properly (both custom characters on the screen will appear identical):
$CustomChar(1,4,4,4,4,4,4,4,0)$Chr(176)$CustomChar(1,7,7,7,7,7,7,7,0)$Chr(176)

This works better because each character uses a unique "slot":
$CustomChar(1,4,4,4,4,4,4,4,0)$Chr(176)$CustomChar(2,7,7,7,7,7,7,7,0)$Chr(158)

...beaten to it by limbo again :wink:
Post Reply