![]() |
VOOZH | about |
dotnet add package nanoFramework.Iot.Device.Rtc --version 1.2.952
NuGet\Install-Package nanoFramework.Iot.Device.Rtc -Version 1.2.952
<PackageReference Include="nanoFramework.Iot.Device.Rtc" Version="1.2.952" />
<PackageVersion Include="nanoFramework.Iot.Device.Rtc" Version="1.2.952" />Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Rtc" />Project file
paket add nanoFramework.Iot.Device.Rtc --version 1.2.952
#r "nuget: nanoFramework.Iot.Device.Rtc, 1.2.952"
#:package nanoFramework.Iot.Device.Rtc@1.2.952
#addin nuget:?package=nanoFramework.Iot.Device.Rtc&version=1.2.952Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Rtc&version=1.2.952Install as a Cake Tool
The RTC devices supported by the project include DS1307, DS3231, PCF8563 (or compatible BM8563).
Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:
//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);
For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.
using System.Device.I2c;
using Iot.Device.Rtc;
using nanoFramework.Hardware.Esp32;
// The I2C pins 21 and 22 in the sample below are ESP32 specific and may differ from other platforms.
// Please double check your device datasheet.
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
I2cConnectionSettings settings = new I2cConnectionSettings(1, Pcf8563.DefaultI2cAddress);
I2cDevice device = I2cDevice.Create(settings);
using (Pcf8563 rtc = new Pcf8563(device))
{
// set Pcf8563 dateTime
// rtc.DateTime = GetDateTimeFromInternet();
rtc.DateTime = new DateTime(2021, 9, 8, 10, 11, 12);
while (true)
{
// read time
DateTime dt = rtc.DateTime;
// output the current time
Debug.WriteLine($"Time: {dt.ToString("yyyy/MM/dd HH:mm:ss")}");
// wait for a second
Thread.Sleep(1000);
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net net is compatible. |
Showing the top 5 NuGet packages that depend on nanoFramework.Iot.Device.Rtc:
| Package | Downloads |
|---|---|
|
nanoFramework.M5Core2
This package includes the nanoFramework.M5Core2 assembly for .NET nanoFramework C# projects. |
|
|
nanoFramework.M5StickC
This package includes the nanoFramework.M5StickC assembly for .NET nanoFramework C# projects. |
|
|
nanoFramework.M5StickCPlus
This package includes the nanoFramework.M5StickCPlus assembly for .NET nanoFramework C# projects. |
|
|
nanoFramework.Tough
This package includes the nanoFramework.Tough assembly for .NET nanoFramework C# projects. |
|
|
nanoFramework.CoreInk
This package includes the nanoFramework.CoreInk assembly for .NET nanoFramework C# projects. |
Showing the top 1 popular GitHub repositories that depend on nanoFramework.Iot.Device.Rtc:
| Repository | Stars |
|---|---|
|
nanoframework/nanoFramework.M5Stack
📦 Board support package for M5Stack, M5StickC and M5StickCPlus for .NET nanoFramework
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.85 | 66 | 6/1/2026 |
| 2.0.0-preview.80 | 63 | 5/27/2026 |
| 2.0.0-preview.73 | 101 | 5/20/2026 |
| 2.0.0-preview.62 | 73 | 5/13/2026 |
| 2.0.0-preview.45 | 98 | 4/29/2026 |
| 2.0.0-preview.32 | 86 | 4/20/2026 |
| 2.0.0-preview.16 | 95 | 3/10/2026 |
| 1.2.952 | 645 | 3/4/2026 |
| 1.2.907 | 1,449 | 10/2/2025 |
| 1.2.889 | 624 | 7/28/2025 |
| 1.2.869 | 1,116 | 4/2/2025 |
| 1.2.864 | 537 | 4/2/2025 |
| 1.2.852 | 816 | 3/11/2025 |
| 1.2.846 | 592 | 3/10/2025 |
| 1.2.822 | 1,774 | 2/26/2025 |
| 1.2.775 | 1,986 | 2/4/2025 |
| 1.2.772 | 327 | 2/4/2025 |
| 1.2.755 | 905 | 1/31/2025 |
| 1.2.743 | 626 | 1/20/2025 |
| 1.2.737 | 310 | 1/13/2025 |