nanoFramework.Iot.Device.RgbDiode 1.0.107

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

RGB diode - PWM

Library designed for controlling RGB diodes using PWM.

Functions

The binding supports the following sensor functions:

  • Control of RGB diodes
  • PWM-based color intensity management

Classes

  • RgbDiode: Main class for RGB LED control

Usage

using Iot.Device.RgbDiode;
using System.Drawing;

const byte redGpioPin = 25;
const byte greenGpioPin = 27;
const byte blueGpioPin = 26;

// Uncomment for ESP32
// nanoFramework.Hardware.Esp32.Configuration.SetPinFunction(redGpioPin, nanoFramework.Hardware.Esp32.DeviceFunction.PWM1);
// nanoFramework.Hardware.Esp32.Configuration.SetPinFunction(greenGpioPin, nanoFramework.Hardware.Esp32.DeviceFunction.PWM2);
// nanoFramework.Hardware.Esp32.Configuration.SetPinFunction(blueGpioPin, nanoFramework.Hardware.Esp32.DeviceFunction.PWM3);

var pwm = new RgbDiode(redGpioPin, greenGpioPin, blueGpioPin);
pwm.SetColor(255, 0, 0); // Should display red
pwm.SetColor(0, 255, 0); // Should display green
pwm.SetColor(0, 0, 255); // Should display blue

pwm.SetColor(Color.LawnGreen);
pwm.SetColor(Color.OrangeRed);
pwm.SetColor(Color.Teal);

pwm.Transition(Color.FromArgb(0, 255, 0)); // Will fade blue to green
pwm.Transition(Color.FromArgb(255, 0, 0)); // Will fade green to red

Important: make sure you properly setup the PWM pins especially for ESP32 before creating the RgbDiode.

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.0.401 206 4/2/2025
1.0.389 197 3/11/2025
1.0.366 114 2/27/2025
1.0.359 111 2/26/2025
1.0.309 125 2/4/2025
1.0.292 115 1/31/2025
1.0.274 127 1/13/2025
1.0.233 142 12/16/2024
1.0.210 127 10/23/2024
1.0.202 117 10/16/2024
1.0.188 118 9/27/2024
1.0.168 124 8/28/2024
1.0.117 140 6/28/2024
1.0.107 114 6/14/2024
1.0.85 107 5/15/2024
1.0.42 255 3/5/2024
1.0.25 286 2/5/2024
1.0.18 313 1/30/2024
1.0.8 349 1/18/2024
1.0.7 341 1/18/2024