Main Site Documentation

NuGet Package Source


#1

Is the NuGet package source available? I’m trying to understand the RTC .DLL and without an example or documentation, I’m struggling a bit. An example of code or documentation would be great. Or point me to examples if they exist. Thanks


#2

The source is not available. The below code should get you going though:

using GHIElectronics.TinyCLR.Devices.Rtc;
using System;
using System.Diagnostics;
using System.Threading;

class Program {
    static void Main() {
        var rtc = RtcController.GetDefault();

        rtc.Now = new DateTime(2019, 1, 8, 9, 0, 0);

        while (true) {
            Debug.WriteLine(rtc.Now.ToString());

            Thread.Sleep(1000);
        }
    }
}

#3

Thank you very much.


#4

No luck. Am I missing or doing something wrong? VS2017.

image

image


#5

It’s ok on a PANDA III
Capture

but not on a FEZ. I think RTC isn’t available because there aren’t crystal on the FEZ schematic like this one which is present on PANDA III!

Capture2


#6

On what device, please?


#7

Gotcha. Wondering then how to set the time / date on the FEZ after a restart of the program. I was thinking the RTC device manager would be a start. Don’t need perfect time like an RTC chip. It always starts at 12:00.


#8

You can add RTC breakout board or a shield. There are many RTC circuit options for very cheap on eBay. Or you can try sparkfun or adafruit.