πŸ“¦ .NET nanoFramework class library for the RMT (remote control) peripheral for ESP32 targets
ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ ΠΊ Ρ„Π°ΠΉΠ»Ρƒ
nfbot 60ec5ed168
Update 1 NuGet dependencies
***NO_CI***
2024-10-21 11:07:37 +01:00
.github/workflows Work CI-CD 2022-12-27 17:01:56 +00:00
assets Work CI-CD 2021-11-25 11:56:08 +00:00
config Work CI-CD 2020-12-28 13:24:35 +00:00
nanoFramework.Hardware.Esp32.Rmt Update 1 NuGet dependencies 2024-10-21 11:07:37 +01:00
.gitattributes Add .gitignore and .gitattributes. 2020-03-06 10:17:34 +00:00
.github_changelog_generator Work CI-CD 2021-05-31 23:46:34 +01:00
.gitignore Update code and API (#2) 2020-07-06 17:13:39 +01:00
CHANGELOG.md Update CHANGELOG for v2.0.10 2024-05-13 13:10:09 +00:00
LICENSE.md Work CI-CD 2021-02-04 14:29:33 +00:00
NuGet.Config Work CI-CD 2021-11-25 11:56:08 +00:00
README.md General improvements towards aligning with ESP32 IDF API (#56) 2023-02-10 12:45:29 +00:00
azure-pipelines.yml Work CI-CD 2024-01-20 21:24:17 +00:00
nanoFramework.Hardware.Esp32.Rmt.nuspec Update 1 NuGet dependencies 2024-05-13 14:03:52 +01:00
nanoFramework.Hardware.Esp32.Rmt.sln Add source clock frequency property (#64) 2024-07-17 23:54:33 +12:00
template.vssettings Update code and API (#2) 2020-07-06 17:13:39 +01:00
version.json General improvements towards aligning with ESP32 IDF API (#56) 2023-02-10 12:45:29 +00:00

README.md

Quality Gate Status Reliability Rating NuGet #yourfirstpr Discord

nanoFramework logo


Welcome to the .NET nanoFramework Hardware.Esp32.Rmt Library repository

RMT (Remote Control) is an ESP32 module driver that is, originally, intended to be used with infrared remote control signals. However, the module and APIs are generic enough that they can used to send/receive other types of signals.

Getting Started

Our samples repository contains commented code showcasing how to use the RMT module in ESP32 MCUs to control various types of devices using nanoFramework. The RMT samples can be found Here.

A detailed explanation about the RMT module can be found here.

Migrating from v1 to v2

There are breaking changes in the managed API surface. If you have existing code that depends on v1.x of this library you will need to refactor it so it works with the new API surface in v2.x.

The changes are mostly around how receive/transmit channels are initialized. The other APIs from v1.x remain as they are.

Please update the code as follows:

V1.x API Surface

// creating a transmit channel
var txChannel = new TransmitterChannel(TxPinNumber);
txChannel.ClockDivider = 80;
txChannel.CarrierEnabled = false;
txChannel.IdleLevel = false;
txChannel.AddCommand(new RmtCommand(20, true, 15, false));
// add more commands...

txChannel.Send(false);

// creating a receive channel
var rxChannel = new ReceiverChannel(RxPinNumber);
rxChannel.ClockDivider = 80; // 1us clock ( 80Mhz / 80 ) = 1Mhz
rxChannel.EnableFilter(true, 100); // filter out 100Us / noise 
rxChannel.SetIdleThresold(40000);  // 40ms based on 1us clock
rxChannel.ReceiveTimeout = new TimeSpan(0, 0, 0, 0, 60); 
rxChannel.Start(true);

In V2.x, the above code must be rewritten as:

var txChannelSettings = new TransmitChannelSettings(-1, TxChannelPinNumber)
{
  ClockDivider = 80,
  EnableCarrierWave = false,
  IdleLevel = false
};

var txChannel = new TransmitterChannel(txChannelSettings);
txChannel.AddCommand(new RmtCommand(20, true, 15, false));
// add more commands...

txChannel.Send(false);


var rxChannelSettings = new ReceiverChannelSettings(pinNumber: RxChannelPinNumber)
{
  EnableFilter = true,
  FilterThreshold = 100,
  IdleThreshold = 40_000,
  ReceiveTimeout = new TimeSpan(0, 0, 0, 0, 60)
};

using var rxChannel = new ReceiverChannel(rxChannelSettings);
rxChannel.Start(clearBuffer: true);

Build status

Component Build Status NuGet Package
nanoFramework.Hardware.Esp32.Rmt Build Status NuGet

Feedback and documentation

For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.

Join our Discord community here.

Credits

The list of contributors to this project can be found at CONTRIBUTORS.

License

The nanoFramework Class Libraries are licensed under the MIT license.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.