コード例 #1
0
        private bool SetupRTC()
        {
            bool rVal = true;

            try
            {
                //var browserTime = new DateTime(2015, 09, 04, 14, 55, 30);
                //DS1307.SetRTCTime(browserTime);
                var rtc = DS1307.GetSingleton();
                DS1307.SetNetduinoTimeFromRTC();
                TrackerState = State.ClockSet;
                Thread.Sleep(2000);
            }
            catch (Exception)
            {
                rVal = false;
            }
            return(rVal);
        }
コード例 #2
0
        private static bool SetupRTC()
        {
            bool rVal = true;

            try
            {
                var rtc = DS1307.GetSingleton();
                //DS1307.SetRTCTime(new DateTime(2014, 11, 17, 15, 14, 01));
                var time = rtc.Get();
                _lcd.SetCursorPosition(0, 0);
                _lcd.Write(time.ToString(Resources.GetString(Resources.StringResources.DateFormat)));
                DS1307.SetNetduinoTimeFromRTC();
                Thread.Sleep(2000);
            }
            catch (Exception)
            {
                rVal = false;
            }
            return(rVal);
        }