nanoFramework.Iot.Device.SparkFunLcd 1.1.429

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.SparkFunLcd --version 1.1.429                
NuGet\Install-Package nanoFramework.Iot.Device.SparkFunLcd -Version 1.1.429                
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="1.1.429" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.SparkFunLcd --version 1.1.429                
#r "nuget: nanoFramework.Iot.Device.SparkFunLcd, 1.1.429"                
#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.
// Install nanoFramework.Iot.Device.SparkFunLcd as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.SparkFunLcd&version=1.1.429

// Install nanoFramework.Iot.Device.SparkFunLcd as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.SparkFunLcd&version=1.1.429                

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.
.NET Framework net 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
1.1.673 76 10/23/2024
1.1.665 77 10/16/2024
1.1.662 78 10/11/2024
1.1.651 84 9/27/2024
1.1.631 101 8/28/2024
1.1.580 104 6/28/2024
1.1.570 112 6/14/2024
1.1.548 108 5/15/2024
1.1.436 235 11/10/2023
1.1.435 109 11/10/2023
1.1.429 91 11/10/2023
1.1.329 166 5/26/2023
1.1.313 133 5/12/2023
1.1.308 134 5/11/2023
1.1.304 145 5/10/2023
1.1.297 146 5/3/2023
1.1.222 298 1/9/2023
1.1.212 291 1/5/2023
1.1.208 284 1/3/2023
1.1.203 285 12/28/2022
1.1.159 363 11/14/2022
1.1.153 361 11/5/2022
1.1.141 375 10/25/2022
1.1.128 369 10/22/2022
1.1.87 468 9/15/2022
1.1.82 461 9/14/2022
1.0.30.8772 422 6/24/2022
1.0.27.2032 402 6/23/2022
1.0.1.45819 399 6/7/2022