Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

marcoe

Member Since 16 Apr 2012
Offline Last Active Oct 25 2015 01:29 AM
-----

Topics I've Started

Creating special characters on LCD

18 September 2015 - 08:23 PM

Hi guys,

 

        I want to share this small code that I created based on a Arduino implementation of a LCD Special Character Creator code. ( http://playground.ar...n/LiquidCrystal )

 

        The .NET Micro Framework Toolbox has the Hd44780LCD class ( https://netmftoolbox...d/Hd44780Lcd.cs ) is great but it only implements basic character output to the LCD display, and I needed to display a low battery sign and this character does not exist on the LCD ROM, so I found out that this kind of display has 8 addresses that we can write to any 5x7 "bitmap" of our choice and then display it.

        public void CreateSpecial(byte[] character, byte location)
        {
            location &= 0x7;
            LCD.Write((byte)(0x40 | (location << 3)), true);
            for (int i = 0; i < 8; i++)
            {
                LCD.Write(character[i]);
            }
        }

           LCD on the code above is the Hd44780Lcd from MFToolbox.

    private static byte[] box1 = { 31, 17, 17, 17, 17, 17, 31 };
    private static byte[] box2 = { 14, 27, 17, 17, 17, 17, 31 };
.
.
.
.

    LCD.CreateSpecial(box1, 0x0);
    LCD.CreateSpecial(box2, 0x1);

    LCD.Write(0x0);
    LCD.Write(0x1);

This website lets you draw your character and just paste it's numbers, makes it a lot easier.

( http://www.quinapalu...hd44780udg.html )

 


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.