Pages: [1]   Go Down
Author Topic: lcd createChar()  (Read 1133 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everybody!
I wonder if there is a function for creating custom caracter for the lcd, if the lcd is connected through I2C!
Thanks for any help!
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It should have!
what device are you using?
what library? (if any) ?

greetings,
Duality
Logged


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

Quote
I wonder if there is a function for creating custom caracter for the lcd, if the lcd is connected through I2C!
That would depend on the nature of the I2C device. 

If you are talking about an I2C device that is functioning as an I/O expander of some sort then it is certainly possible to write such a function.

If the I2C device is actually a serial backpack type of device designed to simplify your LCD experience then it would depend on how the microcontroller on that backpack was programmed.


Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi thanks for youre interest on my problem, here is the lcd with i2c module:
http://www.ebay.com/itm/Chinduino-IIC-I2C-TWI-1602-Serial-LCD-Module-Display-/170830712616?pt=LH_DefaultDomain_0&hash=item27c64dcf28#ht_3705wt_1029

it seems to work with the LiquidCrystal_I2C.h library
Logged

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

Hi thanks for youre interest on my problem, here is the lcd with i2c module:
http://www.ebay.com/itm/Chinduino-IIC-I2C-TWI-1602-Serial-LCD-Module-Display-/170830712616?pt=LH_DefaultDomain_0&hash=item27c64dcf28#ht_3705wt_1029

it seems to work with the LiquidCrystal_I2C.h library
This is the type of information in that should have been in your original post.  Your question is not about the I2C device, it is about the library.  To answer that question you will have to look at the list of functions provided by that library and see if there is one for 'createChar'.

You are dealing with what I have called "an I2C device that is functioning as an I/O expander of some sort" so even if the library does not provide such a function it will certainly be possible to write one of your own.


Don
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what is the mayor diffrence between IOexpander type of device, and backpack type of device?
I don't see it, I think createChar(); should be possible with any type of i2c device or other... it's just how you send the data, Then again,
the library has to support it smiley
Logged


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

Quote
what is the mayor diffrence between IOexpander type of device, and backpack type of device?

I guess I didn't differentiate between the two types of devices well enough since they both can be implemented on a daughterboard or backpack.

In one implementation your sketch generates instructions and data in a form that the LCD controller understands.  This data is converted to serial (I2C) format and sent to the I2C device on the backpack.  That device simply converts the data to a parallel format and sends it on, otherwise unaltered, to the LCD controller.

In the other implementation your sketch generates plain ASCII data to be displayed on the LCD or instructions for the LCD in the form of 'escape' sequences.  This data is converted to serial (I2C) format and sent to the I2C device on the backpack which is typically another microcontroller.  That microcontroller interprets the serial information that it gets, converts the information into a form that the LCD controller understands, and sends it, in parallel, to the LCD controller.


Quote
don't see it, I think createChar(); should be possible with any type of i2c device or other... it's just how you send the data, Then again,
the library has to support it

You are correct.  In the first implementation the library has to support it but even if it doesn't you can still write a function that will do the job.

In the second implementation the person who programmed the microprocessor could and should have implemented all of the capabilities of the LCD controller instruction set. but if they didn't you are out of luck.  So even though createChar() could be implemented it might not be.


Don
Logged

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

Here is an example of 3 Scandinavian characters:

Code:
//////////////Å
uint8_t aa[8]  = {   B00000100,
                     B00001010,
                     B00000100,
                     B00001010,
                     B00010001,
                     B00011111,
                     B00010001 };
                     
lcd.createChar(0, aa);

///////Æ
uint8_t ae[8]  = {   B00000000,
                     B00001111,
                     B00010100,
                     B00011111,
                     B00010100,
                     B00010100,
                     B00010111 };
                     
lcd.createChar(1, ae);

///////////Ø
uint8_t oe[8]  = {   B00000001,
                     B00001110,
                     B00010011,
                     B00010101,
                     B00011001,
                     B00001110,
                     B00010000 };
                     
lcd.createChar(2, oe);

////.........................////
lcd.clear();
lcd.print(char(0));
lcd.print(char(1));
lcd.print(char(2));



Logged

Pages: [1]   Go Up
Jump to: