Esempio n. 1
0
        public async Task SetDateTime(DateTime dateTime)
        {
            if (family != "Windows.Desktop")
            {
                var slave = await I2CDeviceFactory.GetI2CDevice(_deviceType);

                using (_rtc = new SainSmart_DS_1307_RTC(slave))
                {
                    _rtc.SetDateTime(dateTime);
                }
            }
            else
            {
                Debug.WriteLine("This is not a ARM device.");
            }
        }
Esempio n. 2
0
        public async Task <DateTime> GetDateTime()
        {
            DateTime returnDate = DateTime.MinValue;

            if (family != "Windows.Desktop")
            {
                var slave = await I2CDeviceFactory.GetI2CDevice(_deviceType);

                using (_rtc = new SainSmart_DS_1307_RTC(slave))
                {
                    returnDate = _rtc.GetDateTimeNow();
                }
            }
            else
            {
                Debug.WriteLine("This is not a ARM device.");
            }

            return(returnDate);
        }