Home › Forums › Microcontrollers › PIC Microcontroller › Custom Character LCD 4 Bit
Tagged: 16x2, Custom Character, LCD, PIC
- This topic has 4 replies, 2 voices, and was last updated 9 years, 9 months ago by
Ivan.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
December 4, 2014 at 9:47 am #10070
Ivan
ParticipantHi everyone.
I saw the Interfacing LCD with PIC Microcontroller – MPLAB XC8 on electroSome and I did the circuit. It works fine! But I’m wondering. Is there a way to create custom character?
December 4, 2014 at 3:18 pm #10077Ligo George
KeymasterTry the following code :
const unsigned short MyChar5x8[] = { 0x04, 0x0E, 0x1F, 0x0E, 0x04, 0x00, 0x00, 0x00, // Code for char num #0 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F, // Code for char num #1 0x0E, 0x11, 0x1B, 0x11, 0x15, 0x11, 0x11, 0x0E, // Code for char num #2 0x00, 0x11, 0x1F, 0x11, 0x1B, 0x0E, 0x04, 0x00, // Code for char num #3 0x04, 0x0E, 0x1F, 0x0E, 0x04, 0x04, 0x04, 0x04, // Code for char num #4 0x04, 0x04, 0x04, 0x04, 0x04, 0x1F, 0x0E, 0x04, // Code for char num #5 0x1F, 0x00, 0x04, 0x04, 0x0E, 0x00, 0x00, 0x1F, // Code for char num #6 0x1F, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x1F // Code for char num #7 }; void InitCustomChars() { char i; Lcd_Cmd(0x04); Lcd_Cmd(0x00); for (i = 0; i <= 63 ; i++) Lcd_Write_Char(MyChar5x8[i]); Lcd_Cmd(0); Lcd_Cmd(2); } void main() { .... .... Lcd_Init(); .... ... InitCustomChars(); .... ... do { '''' .... Lcd_Set_Cursor(1,1); Lcd_Write_Char(0); //Displays First Custom Character ... } }
December 4, 2014 at 8:20 pm #10084Ivan
ParticipantI’m sorry, before I make this post I tried to search but it seems like I failed.
Thank you 🙂
December 4, 2014 at 8:30 pm #10086Ligo George
KeymasterI tested the above code in PROTEUS, it seems to be working..
December 5, 2014 at 4:03 am #10090Ivan
ParticipantI felt sorry because I did another post about the same subject, I should search more. The code works fine.
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.