nanoFramework.Iot.Device.Ds1302 1.0.55

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Ds1302 --version 1.0.55
                    
NuGet\Install-Package nanoFramework.Iot.Device.Ds1302 -Version 1.0.55
                    
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.Ds1302" Version="1.0.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Ds1302" Version="1.0.55" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Ds1302" />
                    
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.Ds1302 --version 1.0.55
                    
#r "nuget: nanoFramework.Iot.Device.Ds1302, 1.0.55"
                    
#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.Ds1302@1.0.55
                    
#: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.Ds1302&version=1.0.55
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Ds1302&version=1.0.55
                    
Install as a Cake Tool

DS1302 - Realtime Clock

The DS1302 serial real-time clock (RTC) is a lowpower, full binary-coded decimal (BCD) clock/calendar.

Documentation

Sensor Image

sensor

Usage

Connect sensor to the microcontroller.

connection

static void GetTimeFromDs1302()
{
    GpioController controller = new GpioController(PinNumberingScheme.Logical);
    using Ds1302 rtc = new(13, 12, 14, controller);

    if (rtc.IsHalted())
    {
        Console.WriteLine("RTC is halted!");
    }
    else
    {
        rtc.Halt();
        Console.WriteLine("RTC was halted now!");
    }

    var currentTime = new DateTime(2022, 8, 5, 18, 31, 0);
    Console.WriteLine(currentTime.ToString());
    rtc.DateTime = currentTime;

    while (true)
    {
        // read time
        DateTime dt = rtc.DateTime;
        Console.WriteLine(dt.ToString("yyyy/MM/dd HH:mm:ss"));
        Thread.Sleep(5000);
    }
}
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.802 232 4/2/2025
1.0.797 206 4/2/2025
1.0.785 229 3/11/2025
1.0.755 163 2/26/2025
1.0.708 161 2/4/2025
1.0.705 153 2/4/2025
1.0.688 159 1/31/2025
1.0.670 141 1/13/2025
1.0.629 162 12/16/2024
1.0.606 159 10/23/2024
1.0.595 155 10/11/2024
1.0.564 173 8/28/2024
1.0.523 165 7/17/2024
1.0.503 177 6/14/2024
1.0.493 179 5/29/2024
1.0.481 172 5/15/2024
1.0.369 282 11/10/2023
1.0.349 154 11/8/2023
1.0.262 226 5/26/2023
1.0.246 207 5/12/2023
1.0.230 233 5/3/2023
1.0.150 388 1/6/2023
1.0.145 373 1/5/2023
1.0.136 396 12/28/2022
1.0.92 436 11/14/2022
1.0.86 429 11/5/2022
1.0.74 472 10/25/2022
1.0.55 530 10/12/2022
1.0.47 489 10/8/2022
1.0.28 507 9/22/2022
1.0.20 560 9/15/2022
1.0.6 497 9/8/2022
1.0.1 501 9/5/2022