Custom characters on HD44780 display (Nerdkit)

 

 

It took me really a lot of time to turn my Nerdkit into a Pixel Art Machine.

Because of that I wanted to share my experience with the community.

The following code shows one custom character on your nerdkit display.

 

{code lang:c id:22 title:"Main Program" hidden:false}}{/code}

 

This part was for a better understanding how things have to be written and read from the CGRAM.

Please check your makefile for this project.
You have to change from '-Os' to '-O0' in the makefile, or else your display writes anytime into the first line.

To get a clear declaration of the array, you also have to change the following code into your makefile:

 

{code lang:c id:23 title:"Makefile" hidden:false}}{/code}

 

I have modified the original nerdkit LCD library to have a more comfortable use of custom characters.

char pattern01[8]={14,17,17,14,4,6,4,6}; // Key Pattern

lcd_createChar(0, pattern01); // Create Char on position 0x00
lcd_loadCharSingle(0x00); // Loads the Char 0x00 on the current Cursor Position
lcd_loadChar(0,19,0x00); // Loads the Char 0x00 on row 0, column 19

 

You can convert your Images to Numbers on the following Website:
http://www.quinapalus.com/hd44780udg.html

The complete modified nerdkit lcd library is attached here:

 

{code lang:c id:24 title:"lcd.c" hidden:true}}{/code}

{code lang:c id:24 title:"lcd.h" hidden:true}}{/code}

 

Maybe you can use this little tutorial for your Nerdkit Projects.

 

Just a little hint:
You can only save a Maximum of 8 custom characters in the HD44780 display.
But of course you can overwrite and shift them anytime, so really can use a lot of custom characters and moving animations.

Have fun with your own Pixel Art on your Nerdkit.