Using setCustomCharacter in C/C++

C, C++, and Visual C++

Using setCustomCharacter in C/C++

Postby edelachev » Fri Jul 03, 2009 7:25 am

So i've seen the custom character example in C# but am having trouble translating it back into C++.

In my code I use the function like this:
CPhidgetTextLCD_setCustomCharacter(lcd, i, val1, val2);

But I am not sure how to use it after it has been set. Also, I use the above function in a loop, and sometimes the return value is 0 and other times it is 4. What do the return values mean? And is there any better place for documentation? I found the one link, ..., but it seems really basic and get the same info from reading the .h file.



Re: Using setCustomCharacter in C/C++

Postby edelachev » Fri Jul 03, 2009 8:07 am

Well I finally realized that index you pass into the setCustomCharacter function is the index on the ASCII table which your character is stored. So I used the setDisplayCharacter function with said index as the 'character' parameter, and that gives me my custom character.

Also I realized that the setCustomCharacter function returns 4 if it fails and 0 on success. It only returns success when index is 8-15, as it mentions in the docs.

User avatar
Lead Developer
Posts: 3175
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada

Re: Using setCustomCharacter in C/C++

Postby Patrick » Fri Jul 03, 2009 10:25 am

The return codes are documented here: ... const.html - A 4 means invalid argument.

You can also use the codes directly in strings using the /xxx notation - ie "/010/011/012" would be the 1st three custom characters (in octal).


Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 1 guest