I want to display custom characters on LCD like smileys,etc. Can anybody tell me how can I do the same.
I want to display custom characters on LCD like smileys,etc. Can anybody tell me how can I do the same.
/*These are the patterns loaded into the LCD's CGRAM at startup*/
unsigned char pattern3[8]={0x00,0x0E,0x15,0x1B,0x15,0x0E,0x00,0x00}; //Blower On Symbol
unsigned char pattern2[8]={0x04,0x0E,0x1F,0x00,0x04,0x0E,0x1F,0x00}; //Baffle Open Symbol
unsigned char pattern0[8]={0x08,0x14,0x1C,0x14,0x06,0x05,0x05,0x06}; //Access Door Open Symbol
unsigned char pattern1[8]={0x10,0x10,0x10,0x1C,0x06,0x05,0x05,0x06}; //Loading Door Open Symbol
unsigned char pattern4[8]={0x10,0x10,0x10,0x1C,0x07,0x04,0x06,0x04}; //Low Fuel
unsigned char pattern5[8]={0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; //|||||
unsigned char patternF[8]={0x18,0x1F,0x04,0x06,0x04,0x04,0x00,0x00}; //Farenheight
unsigned char patternC[8]={0x18,0x1B,0x04,0x04,0x04,0x03,0x00,0x00}; //Celcius
//This is how the function is used in the main routine when starting up//
LCD_Build_Pattern(0,pattern0);
LCD_Build_Pattern(1,pattern1);
LCD_Build_Pattern(2,pattern2);
LCD_Build_Pattern(3,pattern3);
LCD_Build_Pattern(4,pattern4);
LCD_Build_Pattern(5,pattern5);
LCD_Build_Pattern(6,patternF);
LCD_Build_Pattern(7,patternC);
/*********************************************************
*******************/
//this is the function used to load the custom fonts/graphics into the CGRAM//
void LCD_Build_Pattern(unsigned char location, unsigned char *ptr)
{ unsigned char i;
if(location<8){
LCD_RS=0;
lcd_write(0x40 + (location*8));
DelayMs(5);
LCD_RS=1;
for(i=0;i<8;i++)
lcd_putch(ptr);
DelayMs(5);
};//end if
LCD_RS=1;
lcd_goto(0x00);
}//End build pattern
/****************************************************************************
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
F | LED PWM animation without MCU | Analog & Mixed-Signal Design | 11 | |
E | LED Cube Vertical Animation Failure | Microcontrollers | 8 | |
T | 2 frame 8x8 led matrix animation without microcontroller | Homework Help | 1 | |
A | Sine animation | General Science, Physics & Math | 9 | |
Z | Animation Prob | Homework Help | 0 |