nanoFramework.Iot.Device.RgbDiode 1.0.401

Prefix Reserved
dotnet add package nanoFramework.Iot.Device.RgbDiode --version 1.0.401
                    
NuGet\Install-Package nanoFramework.Iot.Device.RgbDiode -Version 1.0.401
                    
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.401" />
                    
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.401" />
                    
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.401
                    
#r "nuget: nanoFramework.Iot.Device.RgbDiode, 1.0.401"
                    
#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.RgbDiode@1.0.401
                    
#: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.RgbDiode&version=1.0.401
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.RgbDiode&version=1.0.401
                    
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 211 4/2/2025
1.0.389 202 3/11/2025
1.0.366 118 2/27/2025
1.0.359 115 2/26/2025
1.0.309 129 2/4/2025
1.0.292 120 1/31/2025
1.0.274 131 1/13/2025
1.0.233 147 12/16/2024
1.0.210 132 10/23/2024
1.0.202 121 10/16/2024
1.0.188 122 9/27/2024
1.0.168 128 8/28/2024
1.0.117 144 6/28/2024
1.0.107 118 6/14/2024
1.0.85 111 5/15/2024
1.0.42 257 3/5/2024
1.0.25 289 2/5/2024
1.0.18 316 1/30/2024
1.0.8 352 1/18/2024
1.0.7 344 1/18/2024