Custom Characters in LCD 20x4 with ATMEGA328P

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using this library: http://web.alfredstate.edu/facul...

and everything works fine, but im trying to do custom characters on the LCD.

 

I've started fallowing the functions of library until I got to the functions "lcd_write_character_4d" 

which is responsible for sending the character, however the only thing it prints on LCD is a theta θ and the array is a "phone"

 

see:

    lcd_D7_ddr |= (1<<lcd_D7_bit);
    lcd_D6_ddr |= (1<<lcd_D6_bit);
    lcd_D5_ddr |= (1<<lcd_D5_bit);
    lcd_D4_ddr |= (1<<lcd_D4_bit);
    
     lcd_E_ddr |= (1<<lcd_E_bit);
    lcd_RS_ddr |= (1<<lcd_RS_bit);
    
    lcd_init_4d();
    
    unsigned char myuchararray[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
    uint8_t* myuint8array = (uint8_t*)myuchararray;
    
    lcd_write_character_4d(myuint8array);
     _delay_us(80);
    while(1);

 

This topic has a solution.
Last Edited: Mon. Jun 10, 2019 - 10:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did not see any function in the "library" listed to send user defined character data to the cgram of the display.

You need a LCD create char function to store your new character into one of the 8 or 16 custom character locations in the display memory.

Go back to your instructor and ask how to create this function or where it is located or what it is called.

The function your using will display an "ascii" character on the LCD passed to it, and not a pointer to an array as your doing.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I'm the author.  It's not a library, it's a standalone program.  I've never really done anything with the custom characters so there's no function in the program to deal with them.

 

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@awneil

Thanks, this discussion helped me =)

 

@ki0bk

Thanks, your push helped me

 

@floresta1212

It's a pleasure, I'm using these files as the basis for a project, I've turned it into a library in my case.

 

My problem now is that I try to send more than one custom character and it does not take the characters to the side, it just displays the first.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh, my code:

 

main.c

    const char customChar[8] = {0x01, 0x03, 0x05, 0x09, 0x09, 0x0B, 0x1B, 0x18};
    const char customChar1[8] = {0x04, 0x1F, 0x11, 0x11, 0x1F, 0x1F, 0x1F, 0x1F};

    LCD_init();

    LCD_write_custom_character(0, customChar1);

     _delay_us(1000000);

    LCD_command(0x1C);

     _delay_us(1000000);

    LCD_write_custom_character(1, customChar);

    while(1);
void LCD_send_data (unsigned char data){
    LCD_RS_PORT |= (1 << LCD_RS_BIT) | (1 << LCD_E_BIT);
    _delay_us(40);

    LCD_RS_PORT &= ~ (1 << LCD_E_BIT);
    _delay_us(40);

    LCD_RS_PORT |= (1 << LCD_E_BIT);
    _delay_us(100);

    PORTD &= 0x0F;
    PORTD |= (data << 4);
    _delay_us(10);

    LCD_RS_PORT &= ~ (1 << LCD_E_BIT);
    _delay_us(40);
}

void LCD_write_custom_character(unsigned char adress, unsigned char customData[]) {
    LCD_command(0x40 + (adress * 8));             

    for (int i = 0; i < 8; i++) {
        LCD_send_data(customData[i]);
    }

    LCD_command(128);
    LCD_send_data(0);
}

demo:

https://www.avrfreaks.net/sites/...

 

 

Last Edited: Thu. May 31, 2018 - 11:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You really should get rid of that animated gif if you expect us to keep the page open long enough to read your code.

 

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a lot better.

 

Your comments leave a lot to be desired but it looks as if the code you have posted is intended to store your custom characters in the CGRAM.

 

Now you have to write the code to display those characters. 

  • 'Set CGRAM address'
  • 'Read data'

 

 

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

floresta1212 wrote:
Now you have to write the code to display those characters. 'Set CGRAM address' 'Read data'
Eh? Surely it's just as simple as writing as "normal characters" but simply using the low character codes 0x00 to 0x07 (or maybe 0x0F) ?

 

The library has lcd_write_character_4d() so isn't it simply that:

   LCD_write_custom_character(1, customChar);

    while(1);

becomes:

   LCD_write_custom_character(1, customChar);

   lcd_write_character_4d(0x01); // now show custom character 1 on the screen

    while(1);

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Eh? Surely it's just as simple as writing as "normal characters" but simply using the low character codes 0x00 to 0x07 (or maybe 0x0F) ?

 

Sorry about that.  My statement in reply #8 just emphasizes what I said in #4 ... I really haven't done anything with the custom characters!

 

I can say that the low character codes 0x08-0x0F will give the same results as 0x00-0x07 due to memory 'foldback'.

 

Don

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@floresta1212

Sorry, it was not intentional.

I had already reserved the addresses, the display part I do not know how or what command is 

 

@awneil

hahaah, I voted there, hugs

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey, thats worked for two custom characters. Can you explain what this just did? 

 lcd_write_character_4d(0x01);

because I would like to understand to display three, four, five [...] custom characters

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

True, I had to create two functions to start working with custom characters, but the other functions I did not move, I just took advantage of

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you explain what this just did?

The HD44780 usually has room for 8 definable characters. For "fixed" things like 'A' (0x41) or '7' (0x37) when you:

lcd_write_character_4d('A');
lcd_write_character_4d(0x41); // same thing

it goes to its own ROM and gets the 5x7 pattern to show that character on the display - same if you print '7' or 0x37.

 

But the 8 custom characters are different. As you've already found you can load their bit patterns into the HD44780's own RAM (Character Generator RAM). When you ask the HD44780 to print 0xnn then it checks nn and if it's 0x08 or above it just uses a look up in its own fixed ROM for the dot pattern to put on the display. But if it is below 0x08 it picks up the dots from the CG RAM that you previously set instead.

 

The HD44780 keeps redrawing the display using the patterns from the ROM/RAM so if you put an 0x01 on the display and then you go back and edit the dots for custom character 1 any place you have already put in on the display will be seen to change immediately. This disappoints a lot of people as they maybe think they are going to be able to draw an entire alphabet of new characters on the display by first defining 0..7, printing those, then going back and redefining 0..7 and printing them again with new definitions - but the ones already on the display will change too. Do not be surprised when you see this happen !

 

But as long as you are happy with just 8 distinct, non-ROM dot patterns you will be OK. Define custom characters 0..7 then print 0x00 to 0x07 on the display where you want them to appear. If using a string printing function you should even be able to do things like "Hello\x03world" and the character in the middle will be custom character 3. (there are some limitation on "\xNN" so you might prefer to use "\00n" where n = '0' .. '7' so "Hello\003World" for example)

Last Edited: Fri. Jun 1, 2018 - 02:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you explain what this just did? 

I'll try.

 

In 'normal' use when you send a 'character' to the LCD you are really sending it the ASCII code for the character you would like to display.

The LCD controller uses that ASCII code as an address into the CGROM (as shown in Table 4 of the HD44780U datasheet), from which it gets the information it needs to display the character.

For example the letter "B" has the ASCII Code of 0x42 or 0b01000010.  The upper 4 bits put you in the column headed by 0100 and the lower 4 bits put you in the row headed by xxxx0010.

These intersect where the 'B' is shown but the actual information there are the bits that will be used to drive the display.

 

For displaying the custom characters a very similar technique is used.  The 0x01 'character' that you are sending is  00000001  in binary.  The upper 4 bits are 0000 which puts you in the CGRAM column.

The lower four bits are 0001 which puts you in the row headed by xxxx0001 where the LCD controller finds the stuff you previously put there.

 

Don

 

EDIT:  I type with two fingers and one of them has arthritis.

Last Edited: Fri. Jun 1, 2018 - 02:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

. . . When you ask the HD44780 to print 0xnn then it checks nn and if it's 0x08 or above . . .

That's 0x10 or above.  Remember the foldback!

 

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well yeah, but most folks are only really interested in the usable limit:

 

 

You can't get a quart into a pint pot - so 8 definable (and usually accessed as 0x00 to 0x07) is what most folks are really interested in.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is always good to have two points of view about the same thing, it makes it easier to understand.

 

Well, it's very interesting, did not know that it could only set 8 custom characters. That's a HARDWARE limitation, right?

Even more interesting to know is that it redraws the LCD screen almost instantly depending on memory.

 

I guess it's not possible to get around these things with Software.

 

To play I set 8 custom characters and I'm trying to display, see:

 

    LCD_write_custom_character(0, Character1);
    lcd_write_character_4d(0x00);

    LCD_write_custom_character(1, Character2);
    lcd_write_character_4d(0x01);

    LCD_write_custom_character(2, Character3);
    lcd_write_character_4d(0x02);

    LCD_write_custom_character(3, Character4);
    lcd_write_character_4d(0x03);

    LCD_write_custom_character(4, Character5);
    lcd_write_character_4d(0x04);

    LCD_write_custom_character(5, Character6);
    lcd_write_character_4d(0x05);

    LCD_write_custom_character(6, Character7);
    lcd_write_character_4d(0x06);

    LCD_write_custom_character(7, Character8);
    lcd_write_character_4d(0x07);

(I hope you're right, I applied what I understood :D)

 

but I am having problem in the string display, it only displays the 0 character and the 7 character in sequence, I imagine it is replacing and confusing each other, see the function that displays the characters:

 

    void lcd_write_character_4d(uint8_t theData)
    {
        lcd_RS_port |= (1<<lcd_RS_bit);                 // select the Data Register (RS high)
        lcd_E_port &= ~(1<<lcd_E_bit);                  // make sure E is initially low
        lcd_write_4(theData);                           // write the upper 4-bits of the data
        lcd_write_4(theData << 4);                      // write the lower 4-bits of the data
    }
void lcd_write_4(uint8_t theByte)
{
    lcd_D7_port &= ~(1<<lcd_D7_bit);                        // assume that data is '0'
    if (theByte & 1<<7) lcd_D7_port |= (1<<lcd_D7_bit);     // make data = '1' if necessary

    lcd_D6_port &= ~(1<<lcd_D6_bit);                        // repeat for each data bit
    if (theByte & 1<<6) lcd_D6_port |= (1<<lcd_D6_bit);

    lcd_D5_port &= ~(1<<lcd_D5_bit);
    if (theByte & 1<<5) lcd_D5_port |= (1<<lcd_D5_bit);

    lcd_D4_port &= ~(1<<lcd_D4_bit);
    if (theByte & 1<<4) lcd_D4_port |= (1<<lcd_D4_bit);

                                                    // 'Address set-up time' (40 nS)
    lcd_E_port |= (1<<lcd_E_bit);                   // Enable pin high
    _delay_us(1);                                   // implement 'Data set-up time' (80 nS) and 'Enable pulse width' (230 nS)
    lcd_E_port &= ~(1<<lcd_E_bit);                  // Enable pin low
    _delay_us(1);                                   // implement 'Data hold time' (10 nS) and 'Enable cycle time' (500 nS)
}

 

edit:

I put a delay between them and I could see that it displays all the characters, but it shows in the second square of the LCD, without going to the right. I have already seen a function in the LCD datasheet that moved the cursor to the right, does it solve?

Last Edited: Fri. Jun 1, 2018 - 03:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

your explanation is very good, thank you! See my new comment

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

freakshow wrote:
Well, it's very interesting, did not know that it could only set 8 custom characters. That's a HARDWARE limitation, right?
Yeah, like the datasheet said:

So there are only 64 bytes for the whole thing.

 

Remember the HD44780 dates from 30 years or more ago (edit: Wikipedia says launch 1987) and back then 64 bytes were a significant silicon area!

I guess it's not possible to get around these things with Software.

Not entirely true. I think we've seen something here on Freaks that actually demonstrated using a timed process to change the characters part way down the display so you could get more of them showing than the hardware might suggest. However that presumably relies on fairly exact timing that depends on how the HD44780 itself is scanning the display so it might impose fairly strict limitations on the driving MCU to make sure it does the right thing at exactly the right time.

 

If you want multiple definable characters why not simply use a GLCD - this is 2018 after all !

 

PS looking back at your code I wouldn't mix the defining and the displaying if I were you - generally the defining of the custom characters is a one time only operation you do at power on. The later display of what you have previously defined is then something that might be changing over time. IOW:

    LCD_write_custom_character(0, Character1);
    lcd_write_character_4d(0x00);

    LCD_write_custom_character(1, Character2);
    lcd_write_character_4d(0x01);

    LCD_write_custom_character(2, Character3);
    lcd_write_character_4d(0x02);

    LCD_write_custom_character(3, Character4);
    lcd_write_character_4d(0x03);

    LCD_write_custom_character(4, Character5);
    lcd_write_character_4d(0x04);

    LCD_write_custom_character(5, Character6);
    lcd_write_character_4d(0x05);

    LCD_write_custom_character(6, Character7);
    lcd_write_character_4d(0x06);

    LCD_write_custom_character(7, Character8);
    lcd_write_character_4d(0x07);

to be more like:

void setup() {
    LCD_write_custom_character(0, Character1);
    LCD_write_custom_character(1, Character2);
    LCD_write_custom_character(2, Character3);
    LCD_write_custom_character(3, Character4);
    LCD_write_custom_character(4, Character5);
    LCD_write_custom_character(5, Character6);
    LCD_write_custom_character(6, Character7);
    LCD_write_custom_character(7, Character8);
}

void loop() {
    lcd_write_character_4d(0x01);
    lcd_write_character_4d(0x02);
    lcd_write_character_4d(0x03);
    lcd_write_character_4d(0x04);
    lcd_write_character_4d(0x05);
    lcd_write_character_4d(0x06);
    lcd_write_character_4d(0x07);
}

Last Edited: Fri. Jun 1, 2018 - 03:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

Not so long, I was interested in how to create my own character for LCD display and this forum helped to me.

I wrote the small library for LCD and you can use it.

Hope, it will be helpful.

#define RS PC6
#define EN PC7

// LCD_FUNCTIONS

//Настройка дисплея..
void LCD_initial (){	
DDRC |= (1 << RS)|(1 << EN); 
PORTC = 0x00;
DDRD = 0xFF; 
PORTD = 0x00;
_delay_ms(50); 
PORTD |= (1 << PD5);
PORTD &= ~(1 << PD4);
PORTC |= (1 << EN);
PORTC &= ~(1 << EN);
_delay_ms(5);
LCD_send_command(0x28);
LCD_send_command(0x08);
LCD_send_command(0x01);
_delay_us(100);
LCD_send_command(0x06);
_delay_ms(10);
LCD_send_command(0x0C);
};

//Отправляет комманду.
void LCD_send_command(char command){
PORTC &= ~ (1 << RS);
_delay_us(40);
PORTC |= (1 << EN);
_delay_us(100);
PORTD &= 0x0F;
PORTD |= (command & 0xF0);
_delay_us(10);
PORTC &= ~ (1 << EN);
_delay_us(40);
PORTC |= (1 << EN);
_delay_us(100);
PORTD &= 0x0F;
PORTD |= (command << 4);
_delay_us(10);
PORTC &= ~ (1 << EN);
_delay_us(40);
}

//Отправляет данные..
void LCD_send_data (char data){
PORTC |= (1 << RS) | (1 << EN);
_delay_us(40);
PORTD &= 0x0F;
PORTD |= (data & 0xF0);
_delay_us(10);
PORTC &= ~ (1 << EN);
_delay_us(40);
PORTC |= (1 << EN);
_delay_us(100);
PORTD &= 0x0F;
PORTD |= (data << 4);
_delay_us(10);
PORTC &= ~ (1 << EN);
_delay_us(40);
}

// Отправляет строку.
void LCD_send_string(char *string){
while (*string != '\0')
LCD_send_data(*string ++);
}

// Выводит значение в 16-ичной форме..
void LCD_hex (char HEX){
	switch(HEX){
		case 0x00: LCD_send_data('0'); break;
		case 0x01: LCD_send_data('1'); break;
		case 0x02: LCD_send_data('2'); break;
		case 0x03: LCD_send_data('3'); break;
		case 0x04: LCD_send_data('4'); break;
		case 0x05: LCD_send_data('5'); break;
		case 0x06: LCD_send_data('6'); break;
		case 0x07: LCD_send_data('7'); break;
		case 0x08: LCD_send_data('8'); break;
		case 0x09: LCD_send_data('9'); break;
		case 0x0A: LCD_send_data('A'); break;
		case 0x0B: LCD_send_data('B'); break;
		case 0x0C: LCD_send_data('C'); break;
		case 0x0D: LCD_send_data('D'); break;
		case 0x0E: LCD_send_data('E'); break;
		case 0x0F: LCD_send_data('F'); break;
	}
}

// Отправляет пользовательски символ.
void LCD_send_custom_character(char *customChar, char CGRAMadress, char Coloum, char Line){
	// Make sure at correct data.
	if (CGRAMadress >=8)
		return;
		
	if (Coloum >= 15 && Line >= 3){
		LCD_send_command(0x01);
		LCD_send_string("Uncorrect value of line or coloum");
		return;
	}
	
	// Send custom characer to CGRAM adress
	LCD_send_command(0x40 + (CGRAMadress * 8));
	for (uint8_t  i=0; i!=8; i++)
	LCD_send_data (*customChar ++);
	
	if (Line == 0){
		switch(Coloum){
			case 0: LCD_send_command(0x80); break;
			case 1: LCD_send_command(0x81); break;
			case 2: LCD_send_command(0x82); break;
			case 3: LCD_send_command(0x83); break;
			case 4: LCD_send_command(0x84); break;
			case 5: LCD_send_command(0x85); break;
			case 6: LCD_send_command(0x86); break;
			case 7: LCD_send_command(0x87); break;
			case 8: LCD_send_command(0x88); break;
			case 9: LCD_send_command(0x89); break;
			case 10: LCD_send_command(0x8A); break;
			case 11: LCD_send_command(0x8B); break;
			case 12: LCD_send_command(0x8C); break;
			case 13: LCD_send_command(0x8D); break;
			case 14: LCD_send_command(0x8E); break;
			case 15: LCD_send_command(0x8F); break;
		}
	} else if (Line == 1){
		switch(Coloum){
			case 0: LCD_send_command(0xC0); break;
			case 1: LCD_send_command(0xC1); break;
			case 2: LCD_send_command(0xC2); break;
			case 3: LCD_send_command(0xC3); break;
			case 4: LCD_send_command(0xC4); break;
			case 5: LCD_send_command(0xC5); break;
			case 6: LCD_send_command(0xC6); break;
			case 7: LCD_send_command(0xC7); break;
			case 8: LCD_send_command(0xC8); break;
			case 9: LCD_send_command(0xC9); break;
			case 10: LCD_send_command(0xCA); break;
			case 11: LCD_send_command(0xCB); break;
			case 12: LCD_send_command(0xCC); break;
			case 13: LCD_send_command(0xCD); break;
			case 14: LCD_send_command(0xCE); break;
			case 15: LCD_send_command(0xCF); break;
		}
	
	} else if (Line == 2){
		switch(Coloum){
			case 0: LCD_send_command(0x90); break;
			case 1: LCD_send_command(0x91); break;
			case 2: LCD_send_command(0x92); break;
			case 3: LCD_send_command(0x93); break;
			case 4: LCD_send_command(0x94); break;
			case 5: LCD_send_command(0x95); break;
			case 6: LCD_send_command(0x96); break;
			case 7: LCD_send_command(0x97); break;
			case 8: LCD_send_command(0x98); break;
			case 9: LCD_send_command(0x99); break;
			case 10: LCD_send_command(0x9A); break;
			case 11: LCD_send_command(0x9B); break;
			case 12: LCD_send_command(0x9C); break;
			case 13: LCD_send_command(0x9D); break;
			case 14: LCD_send_command(0x9E); break;
			case 15: LCD_send_command(0x9F); break;
		}
		
	} else if (Line == 3){
		switch(Coloum){
			case 0: LCD_send_command(0xD0); break;
			case 1: LCD_send_command(0xD1); break;
			case 2: LCD_send_command(0xD2); break;
			case 3: LCD_send_command(0xD3); break;
			case 4: LCD_send_command(0xD4); break;
			case 5: LCD_send_command(0xD5); break;
			case 6: LCD_send_command(0xD6); break;
			case 7: LCD_send_command(0xD7); break;
			case 8: LCD_send_command(0xD8); break;
			case 9: LCD_send_command(0xD9); break;
			case 10: LCD_send_command(0xDA); break;
			case 11: LCD_send_command(0xDB); break;
			case 12: LCD_send_command(0xDC); break;
			case 13: LCD_send_command(0xDD); break;
			case 14: LCD_send_command(0xDE); break;
			case 15: LCD_send_command(0xDF); break;
		}
	}
	
	
	//Display my custom character.
	LCD_send_data (CGRAMadress);

}

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
    const char customChar[8] = {0x01, 0x03, 0x05, 0x09, 0x09, 0x0B, 0x1B, 0x18};
    const char customChar1[8] = {0x04, 0x1F, 0x11, 0x11, 0x1F, 0x1F, 0x1F, 0x1F};

if you go for the array approach and use a C compiler that offers 0b prefixes then what's more the arrays may become:

    const char customChar[8] = {
        0b00000001,
        0b00000011,
        0b00000101,
        0b00001001,
        0b00001011,
        0b00011011,
        0b00011000
    };
    const char customChar1[8] = {
        0b00000100,
        0b00011111,
        0b00010001,
        0b00010001,
        0b00011111,
        0b00011111,
        0b00011111,
        0b00011111
    };

so that if you screw your eyes up you can almost "see" the characters in the C source.

 

One thing I would do is make the "const char" to be "const __flash uint8_t" though (unless C++ rather than C). No point wasting RAM on something that won't be changing at run time.

Last Edited: Fri. Jun 1, 2018 - 04:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did not know about this GLCD, what are the differences?

 

well, I do not know why, but it worked after organizing the way that guided me. Thank you!

 

Actually using this form of structure I can almost see the pixels, a very useful tool is: https://omerk.github.io/lcdchargen/

 

@Feni

thanks, this will help others users!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The G in GLCD means Graphic (your current LCD is "text") instead of having fixed positions for fixed (apart from 8) characters it is simply a large grid of individually controlled dots (a bit like your TV screen only smaller) by turning on the right dots you can draw points, lines, boxes, circles, text in any kind of fancy font you choose or even pictures. They are a bit more expensive and a bit more complicated to operate but would be the usual choice for anyone trying to display "unusual" characters or even whole new alphabets like hebrew, arabic or chinese.
.
Not only your TV but most likely your mobile phone, your satnav, your camera and similar devices all use GLCD. Probably even your microwave or washing machine (higher end models) some are just 2 color, some are multicolor.
.
Actually the device you are reading Freaks on is likely a GLCD too.

PS here's the kind of thing you can do... 

Last Edited: Fri. Jun 1, 2018 - 06:27 PM