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.
#addin nuget:?package=nanoFramework.Iot.Device.RgbDiode&version=1.0.401
                    
Install nanoFramework.Iot.Device.RgbDiode as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.RgbDiode&version=1.0.401
                    
Install nanoFramework.Iot.Device.RgbDiode 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 180 4/2/2025
1.0.389 185 3/11/2025
1.0.366 102 2/27/2025
1.0.359 99 2/26/2025
1.0.309 115 2/4/2025
1.0.292 104 1/31/2025
1.0.274 117 1/13/2025
1.0.233 131 12/16/2024
1.0.210 116 10/23/2024
1.0.202 107 10/16/2024
1.0.188 106 9/27/2024
1.0.168 113 8/28/2024
1.0.117 130 6/28/2024
1.0.107 103 6/14/2024
1.0.85 96 5/15/2024
1.0.42 245 3/5/2024
1.0.25 275 2/5/2024
1.0.18 303 1/30/2024
1.0.8 338 1/18/2024
1.0.7 330 1/18/2024