Characteristic Locus
Inheritance System.Object > CharacterDisplay
Namespace Meadow.Foundation.Displays.Lcd
Assembly CharacterDisplay.dll

Syntax

public class CharacterDisplay : ITextDisplay

Examples

The following example shows how to print an incrementing counter every second on the LCD display:

using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Displays.Lcd;
using System;
using System.Threading;

namespace LedSample
{
    public class Program
    {
        static IApp app; 

        public static void Main()
        {
            Console.WriteLine("Hello LCD");

            app = new CharacterDisplayApp();
            Thread.Sleep(Timeout.Infinite);
        }
    }

    class CharacterDisplayApp : App<F7Micro, CharacterDisplayApp>
    {
        CharacterDisplay display;

        public CharacterDisplayApp()
        {
            display = new CharacterDisplay(
                Device,
                pinRS: Device.Pins.D05,
                pinE:  Device.Pins.D07,
                pinD4: Device.Pins.D08,
                pinD5: Device.Pins.D09,
                pinD6: Device.Pins.D10,
                pinD7: Device.Pins.D11,
                rows: 2, columns: 16    // Adjust dimensions to fit your display
                );

            int count = 0;
            display.WriteLine("CharacterDisplay", 0);

            while (true)
            {
                display.WriteLine($"Count is : {count++}", 1);
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}
Example Circuit

Constructors

View Source

CharacterDisplay(IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, UInt16, UInt16)

Declaration
public CharacterDisplay(IDigitalOutputPort portRS, IDigitalOutputPort portE, IDigitalOutputPort portD4, IDigitalOutputPort portD5, IDigitalOutputPort portD6, IDigitalOutputPort portD7, ushort rows = 4, ushort columns = 20)

Parameters

Type Name Description
IDigitalOutputPort portRS
IDigitalOutputPort portE
IDigitalOutputPort portD4
IDigitalOutputPort portD5
IDigitalOutputPort portD6
IDigitalOutputPort portD7
System.UInt16 rows
System.UInt16 columns
View Source

CharacterDisplay(IIODevice, IPin, IPin, IPin, IPin, IPin, IPin, UInt16, UInt16)

Declaration
public CharacterDisplay(IIODevice device, IPin pinRS, IPin pinE, IPin pinD4, IPin pinD5, IPin pinD6, IPin pinD7, ushort rows = 4, ushort columns = 20)

Parameters

Type Name Description
IIODevice device
IPin pinRS
IPin pinE
IPin pinD4
IPin pinD5
IPin pinD6
IPin pinD7
System.UInt16 rows
System.UInt16 columns

Fields

View Source

LCD_D4

Declaration
protected IDigitalOutputPort LCD_D4

Field Value

Type Description
IDigitalOutputPort
View Source

LCD_D5

Declaration
protected IDigitalOutputPort LCD_D5

Field Value

Type Description
IDigitalOutputPort
View Source

LCD_D6

Declaration
protected IDigitalOutputPort LCD_D6

Field Value

Type Description
IDigitalOutputPort
View Source

LCD_D7

Declaration
protected IDigitalOutputPort LCD_D7

Field Value

Type Description
IDigitalOutputPort
View Source

LCD_E

Declaration
protected IDigitalOutputPort LCD_E

Field Value

Type Description
IDigitalOutputPort
View Source

LCD_RS

Declaration
protected IDigitalOutputPort LCD_RS

Field Value

Type Description
IDigitalOutputPort
View Source

LED_ON

Declaration
protected IDigitalOutputPort LED_ON

Field Value

Type Description
IDigitalOutputPort

Properties

View Source

DisplayConfig

Declaration
public TextDisplayConfig DisplayConfig { get; protected set; }

Property Value

Type Description
TextDisplayConfig

Methods

View Source

Clear()

Declaration
public void Clear()
View Source

ClearLine(Byte)

Declaration
public void ClearLine(byte lineNumber)

Parameters

Type Name Description
System.Byte lineNumber
View Source

SaveCustomCharacter(Byte[], Byte)

Declaration
public void SaveCustomCharacter(byte[] characterMap, byte address)

Parameters

Type Name Description
System.Byte[] characterMap
System.Byte address
View Source

SetBrightness(Single)

Declaration
public void SetBrightness(float brightness = 0.75F)

Parameters

Type Name Description
System.Single brightness
View Source

SetCursorPosition(Byte, Byte)

Declaration
public void SetCursorPosition(byte column, byte line)

Parameters

Type Name Description
System.Byte column
System.Byte line
View Source

Write(String)

Declaration
public void Write(string text)

Parameters

Type Name Description
System.String text
View Source

WriteLine(String, Byte)

Declaration
public void WriteLine(string text, byte lineNumber)

Parameters

Type Name Description
System.String text
System.Byte lineNumber