V1/Toolbox.NETMF.Hardware.LcdBoost/LcdBoostDriverHD44780.cs
/// <summary>
/// Defines the pattern for a custom character
/// </summary>
/// <param name="code">The character code which the pattern is related to</param>
/// <param name="pattern">The bit pattern which defines the aspect</param>
/// <remarks>
/// There are up to 8 codes available for custom characters:
/// the codes span from 0 to 7, inclusive.
/// Upon the display type, a character can be composed either
/// by a 5x8 pixel matrix (most common), or a 5x10 pixel matrix.
/// However, the most bottom row is reserved for cursor.
/// Also see the HD44780 datasheet
/// </remarks>
/// <example>
/// Suppose you would like to define the following
/// 5x7 custom pattern for the code 0x02:
/// 
///     #####
///     #
///     #
///     ###
///     #
///     #
///     #
///     
/// Note: each '#' symbol is actually a pixel
/// 
/// The related code to define the pattern will be:
/// <code>
///     driver.DefineCustomCharacter(
///         0x02,   //the address of the character
///         new byte[7] { 0x1F, 0x10, 0x10, 0x1C, 0x10, 0x10, 0x10 }
///         );
/// </code>
/// </example>
Defines the pattern for a custom character
Defines the pattern for a custom character
public void DefineCustomCharacter(
            int code,
            byte[] pattern)
        {
            int address = 0x40 + ((code << 3) & 0x38);
            WriteCommand(address);
            int count = pattern.Length;
            if (count > 10)
                count = 10;
            for (int i = 0; i < count; i++)
                WriteData(pattern[i]);
            this.Send();
        }
public void DefineCustomCharacter ( int code , byte [ ] pattern ) { int address = 0x40 + ( ( code << 3 ) & 0x38 ) ; WriteCommand ( address ) ; int count = pattern . Length ; if ( count > 10 ) count = 10 ; for ( int i = 0 ; i < count ; i ++ ) WriteData ( pattern [ i ] ) ; this . Send ( ) ; }
Defines the pattern for a custom character
Defines the pattern for a custom character
code
int
The character code which the pattern is related to
The character code which the pattern is related to
pattern
byte[]
The bit pattern which defines the aspect
The bit pattern which defines the aspect
remarks
There are up to 8 codes available for custom characters:
the codes span from 0 to 7, inclusive.
Upon the display type, a character can be composed either
by a 5x8 pixel matrix (most common), or a 5x10 pixel matrix.
However, the most bottom row is reserved for cursor.
Also see the HD44780 datasheet
There are up to 8 codes available for custom characters : the codes span from 0 to 7 inclusive . Upon the display type a character can be composed either by a 5x8 pixel matrix ( most common ) or a 5x10 pixel matrix . However the most bottom row is reserved for cursor . Also see the HD44780 datasheet
example
Suppose you would like to define the following
5x7 custom pattern for the code 0x02.









each '#' symbol is actually a pixel

The related code to define the pattern will be.


Suppose you would like to define the following 5x7 custom pattern for the code 0x02 . each ' # ' symbol is actually a pixel The related code to define the pattern will be .