nanoFramework.Iot.Device.SparkFunLcd 2.0.0-preview.80

Prefix Reserved
This is a prerelease version of nanoFramework.Iot.Device.SparkFunLcd.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.SparkFunLcd --version 2.0.0-preview.80
                    
NuGet\Install-Package nanoFramework.Iot.Device.SparkFunLcd -Version 2.0.0-preview.80
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.SparkFunLcd" Version="2.0.0-preview.80" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.SparkFunLcd" Version="2.0.0-preview.80" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.SparkFunLcd" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.SparkFunLcd --version 2.0.0-preview.80
                    
#r "nuget: nanoFramework.Iot.Device.SparkFunLcd, 2.0.0-preview.80"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.SparkFunLcd@2.0.0-preview.80
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.SparkFunLcd&version=2.0.0-preview.80&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.SparkFunLcd&version=2.0.0-preview.80&prerelease
                    
Install as a Cake Tool

LCD library for SparkFun RGB Serial Open LCD display (sizes 20x4 or 16x2) with I2C connection

Use SparkFunLcd.cs to drive SparkFun LCD modules via I2C.

For example product information see SparkFun LCD-16398

The code contained in this driver is based on see OpenLCD

Usage

For instance the following code writes a simple message to the display,

var settings = new I2cConnectionSettings(busId: 1, deviceAddress: SparkFunLcd.DefaultI2cAddress, busSpeed: I2cBusSpeed.StandardMode);
using (var i2cDevice = I2cDevice.Create(settings))
{
    using (var lcd = new SparkFunLcd(i2cDevice, SparkFunLcd.DisplaySizeEnum.Size20x4))
    {
        lcd.SetBacklight(Color.FromArgb(0, 255, 0));
        lcd.SetContrast(4);
        lcd.SetDisplayState(false);
        lcd.Clear();
        lcd.Write(0, 0, "SparkFun 20x4 SerLCD");
        lcd.Write(0, 1, "P/N# LCD-16398");
        lcd.SetDisplayState(true);
    }
}

(code validated against Adafruit Huzzah32 Feather)

Example usage

Custom Characters

  • As shown in the photo above custom characters can be defined
  • Up to eight custom characters can be defined numbered 0x0 thru 0x7
  • for information on generating the byte array character bit mask see link
// demonstrating custom characters
{
    lcd.CreateCustomCharacter(0, new byte[] { 0x0, 0x1b, 0xe, 0x4, 0xe, 0x1b, 0x0, 0x0 }); // define custom character 0x0
    lcd.CreateCustomCharacter(1, new byte[] { 0x0, 0x1, 0x3, 0x16, 0x1c, 0x8, 0x0, 0x0 }); // define custom character 0x1

    lcd.Clear();
    lcd.SetCursorPosition(0, 0);
    lcd.Write(new char[] { '\x0', '\x1' }); // write custom character 0x0 followed by custom character 0x1
}

Important note on use of I2C pins

Important: make sure chip pins are properly configured as I2C pins, for instance for ESP32,

// configure ESP32 device I2C bus
{
    // note: actual pin-out is specific to Adafruit Huzzah32 Feather on which code was tested
    int dataPin = Gpio.IO23;
    int clockPin = Gpio.IO22;
    Configuration.SetPinFunction(dataPin, DeviceFunction.I2C1_DATA);
    Configuration.SetPinFunction(clockPin, DeviceFunction.I2C1_CLOCK);
}
Product Compatible and additional computed target framework versions.
.NETnanoFramework netnano1.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.85 45 6/1/2026
2.0.0-preview.80 49 5/27/2026
2.0.0-preview.69 46 5/18/2026
2.0.0-preview.62 54 5/13/2026
2.0.0-preview.49 51 5/4/2026
2.0.0-preview.45 59 4/29/2026
2.0.0-preview.40 56 4/27/2026
2.0.0-preview.37 56 4/22/2026
2.0.0-preview.32 54 4/20/2026
2.0.0-preview.18 73 3/11/2026
2.0.0-preview.16 67 3/10/2026
1.1.907 264 10/2/2025
1.1.864 336 4/2/2025
1.1.852 321 3/11/2025
1.1.822 257 2/26/2025
1.1.772 300 2/4/2025
1.1.755 274 1/31/2025
1.1.737 234 1/13/2025
1.1.696 288 12/16/2024
1.1.673 244 10/23/2024
Loading failed