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

Customchar? How does it work?

General discussion about LCD Smartie.

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

Post Reply
hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Customchar? How does it work?

Post by hydrolisk1792 »

Okay, I can't get the "$customchar" string to work the way I thought it would. In Crystalcontrol2 there is a spot to make your own characters. Is there some way to do the same thing in LCDSmartie? I would wrather use Smartie over CC2 because of the versitility of Smartie over CC2. I am using some CFA635 USB modules which DO infact accept the custom characters. For my instlitation, I NEED to make some logos on them because this is for home automation. I have an understang on how to do it like how to make the string, but when I put it into Smartie, it does nothing, lol. Here is an example of one of the logo/icons I Need to use on the screens.
Image

Is this even possible to do in Smartie? And can I have more than 8 custom characters on one incarnation of Smartie? There will be about 20-30 incarnations of Smartie running on a screen server when this is all said and done, but I'm just trying to see the limitations of Smartie at the moment because this is the program that I ultiatly need to be using in conjunction with everything else that will be running at the time. Oh, another add on, in CC2, in one incarnation of CC2, you can have 8 custom characters per screen, so is that possible too? Oh, one more thing too, that icon that I posted above, it needs to fit together like that, it is split into 6 characters, but needs to fit together when on the screens. Also, is there a way to animate it like in CC2 as well?

I know what you are thinking, "Just use CC2" right? Well, here is my problem with it, number one, uses too many recources, can only have one incarnation open at a time, limited to just the crystalfontz modules, and the list goes on. Yeah, I do order a lot from Crystalfonts website, but I really don't care for their software and customer support, lol. Thanks ahead of time, lol.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: Customchar? How does it work?

Post by mattcro »

HD44780 compatible LCDs can display up to 8 custom characters at any time. This is a limitation of the LCD controller, not Smartie itself. So on any Smartie screen, you can use up to 8 custom chars.

To display a custom char, you need to define the character bitmap (using $CustomChar) and then insert that char in the screen using the appropriate $Chr() command. You can see a list of these at the bottom of the commands reference webpage: http://lcdsmartie.sourceforge.net/commands.html

So, to define and insert a CPU fan custom char using custom char 8, do this:

Code: Select all

$CustomChar(8,0,25,11,4,26,19,0,0)$Chr(136)
The reason for the weird list of $Chr codes for the custom chars is historical... possibly it's a selection of rarely-used character codes form the LCD native character set, and Smartie "redirects" these char codes to the LCD custom character codes which are usually at 0-7 in the LCD's character set. You cannot display $Chr(0), because the byte value 0 is not allowed in text strings. However, you can access the other custom chars using $Chr(1) to $Chr(7)

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: Customchar? How does it work?

Post by hydrolisk1792 »

OMFG, that is so awsome, it works. It is a little complicated, but that is alright for me, I like it complicated!! :)

Okay, that works perfectly. To my understanding, there can be 8 characters per screen, right? Line if I use all 8 on "Theme 1 Screen 1", I can use a new set on Theme 1 Screen 2"? Sorry for all the strange questions, lol.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: Customchar? How does it work?

Post by mattcro »

Yup, you can have 8 custom chars defined for each screen, so you can have your "splash" startup screen with the big graphic, then switch to another screen which has a bargraph, then switch to another screen which has big numbers...

The limitation is really in the display - it has 8 "slots" for custom characters, and you can define and use them as and when you wish. You can insert each custom char multiple times on a screen so you could for example create a wiggly divider line or repeating pattern using a single custom char.

Note that custom chars are used by some plugins and commands like the bargraphs, bignum, spectrum analyser etc, so you have to be careful which custom chars you use for static icons etc on your screens. If you create a 1x6 tinygraph, then you only have 2 spare custom chars to play with.

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: Customchar? How does it work?

Post by hydrolisk1792 »

Wow, thanks for all the help and all the details on what needs to be done here :) The customer support here is AAA 100%. I think that a lot of places need to be on here and take some notes on the customer service, lol. :D

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: Customchar? How does it work?

Post by hydrolisk1792 »

Oh, something else to add, is there somplace where I can get all the $Chr(000) codes at? Like where can I see what all the numbers represent? Thanks

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Re: Customchar? How does it work?

Post by caesar »

For the characters specifically to your display you will have to consult its datasheet.

Otherwise, for the ascii table: http://lmgtfy.com/?q=ascii+table&l=1

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: Customchar? How does it work?

Post by hydrolisk1792 »

caesar wrote:For the characters specifically to your display you will have to consult its datasheet.

Otherwise, for the ascii table: http://lmgtfy.com/?q=ascii+table&l=1

Okay, that is awsome, thank you. :smt006

Post Reply