nanoFramework.Iot.Device.Rtc
1.2.396
dotnet add package nanoFramework.Iot.Device.Rtc --version 1.2.396
NuGet\Install-Package nanoFramework.Iot.Device.Rtc -Version 1.2.396
<PackageReference Include="nanoFramework.Iot.Device.Rtc" Version="1.2.396" />
paket add nanoFramework.Iot.Device.Rtc --version 1.2.396
#r "nuget: nanoFramework.Iot.Device.Rtc, 1.2.396"
// Install nanoFramework.Iot.Device.Rtc as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Rtc&version=1.2.396
// Install nanoFramework.Iot.Device.Rtc as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Rtc&version=1.2.396
Realtime Clock
The RTC devices supported by the project include DS1307, DS3231, PCF8563 (or compatible BM8563).
Documentation
Board
Usage
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.
Hardware Required
- DS1307/DS3231/PCF8563/BM8563
- Male/Female Jumper Wires
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);
}
}
Result
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.14.2)
- nanoFramework.Iot.Device.Common.NumberHelper (>= 1.2.325)
- nanoFramework.System.Device.I2c (>= 1.1.11)
- UnitsNet.nanoFramework.Temperature (>= 5.34.0)
NuGet packages (4)
Showing the top 4 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. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on nanoFramework.Iot.Device.Rtc:
Repository | Stars |
---|---|
nanoframework/nanoFramework.IoT.Device
📦 This repo includes .NET nanoFramework implementations for various sensors, chips, displays, hats and drivers
|
Version | Downloads | Last updated |
---|---|---|
1.2.396 | 73 | 9/27/2023 |
1.2.384 | 267 | 9/6/2023 |
1.2.378 | 384 | 8/16/2023 |
1.2.369 | 316 | 8/2/2023 |
1.2.363 | 212 | 7/28/2023 |
1.2.357 | 282 | 7/19/2023 |
1.2.354 | 240 | 7/14/2023 |
1.2.345 | 387 | 6/21/2023 |
1.2.341 | 291 | 6/14/2023 |
1.2.337 | 302 | 6/7/2023 |
1.2.335 | 118 | 6/2/2023 |
1.2.329 | 352 | 5/26/2023 |
1.2.313 | 521 | 5/12/2023 |
1.2.302 | 397 | 5/10/2023 |
1.2.297 | 353 | 5/3/2023 |
1.2.273 | 1,771 | 3/17/2023 |
1.2.267 | 959 | 3/10/2023 |
1.2.263 | 711 | 3/8/2023 |
1.2.259 | 787 | 2/27/2023 |
1.2.256 | 696 | 2/24/2023 |
1.2.253 | 697 | 2/22/2023 |
1.2.222 | 1,873 | 1/9/2023 |
1.2.212 | 2,473 | 1/5/2023 |
1.2.208 | 336 | 1/3/2023 |
1.2.203 | 1,006 | 12/28/2022 |
1.2.153 | 3,682 | 11/5/2022 |
1.2.141 | 3,640 | 10/25/2022 |
1.2.125 | 1,453 | 10/12/2022 |
1.2.87 | 9,725 | 9/15/2022 |
1.2.68 | 2,463 | 9/5/2022 |
1.2.63 | 1,388 | 9/3/2022 |
1.2.47 | 1,518 | 8/15/2022 |
1.2.40 | 1,751 | 8/6/2022 |
1.2.38 | 1,482 | 8/5/2022 |
1.2.28 | 4,495 | 8/1/2022 |
1.2.13 | 3,622 | 7/24/2022 |
1.2.10 | 1,519 | 7/23/2022 |
1.1.142.3202 | 3,835 | 7/7/2022 |
1.1.133.52556 | 4,729 | 6/30/2022 |
1.1.121.35854 | 3,595 | 6/26/2022 |
1.1.116.8772 | 2,539 | 6/24/2022 |
1.1.113.2032 | 415 | 6/23/2022 |
1.1.102.51394 | 2,658 | 6/15/2022 |
1.1.99.36719 | 1,470 | 6/14/2022 |
1.1.72.29765 | 8,483 | 5/31/2022 |
1.1.61.27737 | 3,815 | 5/25/2022 |
1.1.58.10097 | 1,284 | 5/23/2022 |
1.1.54.28879 | 1,260 | 5/23/2022 |
1.1.40 | 3,855 | 5/5/2022 |
1.1.3 | 12,066 | 4/15/2022 |
1.1.1 | 419 | 4/14/2022 |
1.0.303 | 1,285 | 4/12/2022 |
1.0.302 | 4,310 | 3/31/2022 |
1.0.288-preview.114 | 131 | 3/25/2022 |
1.0.288-preview.113 | 105 | 3/25/2022 |
1.0.288-preview.112 | 113 | 3/25/2022 |
1.0.288-preview.103 | 118 | 3/21/2022 |
1.0.288-preview.100 | 116 | 3/19/2022 |
1.0.288-preview.96 | 137 | 3/16/2022 |
1.0.288-preview.86 | 176 | 3/8/2022 |
1.0.288-preview.77 | 143 | 2/27/2022 |
1.0.288-preview.75 | 112 | 2/26/2022 |
1.0.288-preview.69 | 129 | 2/18/2022 |
1.0.288-preview.63 | 127 | 2/16/2022 |
1.0.288-preview.61 | 118 | 2/12/2022 |
1.0.288-preview.58 | 111 | 2/10/2022 |
1.0.288-preview.53 | 106 | 2/9/2022 |
1.0.288-preview.41 | 155 | 1/31/2022 |
1.0.288-preview.22 | 227 | 1/27/2022 |
1.0.288-preview.20 | 124 | 1/27/2022 |
1.0.288-preview.18 | 135 | 1/27/2022 |
1.0.288-preview.5 | 150 | 1/24/2022 |
1.0.272 | 555 | 1/10/2022 |
1.0.260 | 862 | 12/10/2021 |
1.0.259 | 288 | 12/9/2021 |
1.0.258 | 261 | 12/7/2021 |
1.0.225 | 462 | 10/22/2021 |
1.0.165 | 366 | 9/10/2021 |
1.0.157 | 313 | 9/4/2021 |
1.0.155 | 317 | 8/31/2021 |
1.0.153 | 311 | 8/14/2021 |
1.0.151 | 320 | 8/6/2021 |
1.0.146 | 306 | 7/22/2021 |
1.0.136 | 368 | 7/17/2021 |
1.0.134 | 158 | 7/15/2021 |
1.0.133 | 172 | 7/14/2021 |
1.0.130 | 177 | 7/6/2021 |
1.0.129 | 156 | 7/6/2021 |
1.0.127 | 163 | 7/5/2021 |
1.0.125 | 182 | 7/5/2021 |
1.0.122 | 199 | 6/30/2021 |
1.0.121 | 181 | 6/29/2021 |
1.0.119 | 207 | 6/28/2021 |
1.0.111 | 164 | 6/14/2021 |
1.0.105 | 265 | 5/29/2021 |
1.0.104 | 236 | 5/29/2021 |
1.0.97 | 158 | 5/28/2021 |
1.0.67 | 185 | 5/26/2021 |