real-time-clock

How datetime.datetime.now() works without internet connection?

走远了吗. 提交于 2020-06-11 10:42:26
问题 In python, by importing datetime module and using various functions of class datetime.datetime we could get basic dates with formatting and even date arithmetic for deployment. For example, datetime.datetime.now() will return today's date. But, today when I run this program there was no internet connection in my computer but still it outputs today's date. So, how datetime.datetime.now() could return proper date? Is the algorithm automatically increment after 24 hours time ? 回答1: tl;dr

RTC with msp430

折月煮酒 提交于 2020-01-01 20:09:21
问题 I have asked this question before, but I think this time I can ask with some more clarity. The below is my RTC Test code. I am using msp430f5418 with IAR EW 5. My problem is after some time (we tested with 15 minutes and more) the minutes interrupt is coming earlier than expected. ie, On first time, after exactly 60 seconds and after 15 minutes the minute interrupt comes on 45th seconds itself. Why is it so? We are using the library provided by TI for RTC register manipulation. Can anybody

RTC with msp430

折月煮酒 提交于 2020-01-01 20:09:11
问题 I have asked this question before, but I think this time I can ask with some more clarity. The below is my RTC Test code. I am using msp430f5418 with IAR EW 5. My problem is after some time (we tested with 15 minutes and more) the minutes interrupt is coming earlier than expected. ie, On first time, after exactly 60 seconds and after 15 minutes the minute interrupt comes on 45th seconds itself. Why is it so? We are using the library provided by TI for RTC register manipulation. Can anybody

Clock that is able to “tick”

左心房为你撑大大i 提交于 2019-12-24 10:57:54
问题 I was coding a program using Java for a clock that is able to "tick" but there are problems with it. I assume it has something to do with the getter and setters, or the toString() method. counter class package clock; public class Counter { private int _count; private String _name; public String getName(){return _name;} public void setName(String _name){this._name = _name;} public int getCount(){return _count;} public void setCount(int _count){this._count = _count;} public Counter(String name)

NTP and RTC HW Clock weird results

偶尔善良 提交于 2019-12-24 07:33:15
问题 In an attempt to make the system time on an ODroid as close to realtime as possible, I've tried adding a real time clock to the ODroid. The RTC has an accuracy of +/- 4ppm. Without the realtimeclock, I would get results like this (Synced with NTP-server every 60 seconds). The blue is an Orange Pi for comparison. The x-axis is the sample, and the y-axis is the offset reported by the NTP-server in ms. So what I tried, was the same thing (Though more samples, but same interval), but instead of

how to wakeup android phone from sleep?

耗尽温柔 提交于 2019-12-12 08:25:54
问题 How to wakeup android phone from sleep (suspend to mem) programmably? I don't want to acquire any wakelock, which means the phone goes into "real" sleep with the cpu disabled. I guess I can use some kind of RTC (real time clock) mechanism? Does anyone have any examples? Thanks. 回答1: In order to let the Activity wake up the device and not require a password/swipe, you only need to add a few flags. To get that, include to your code: this.getWindow().setFlags(WindowManager.LayoutParams.FLAG

Android AlarmManager RTC doesn't pause while device is sleeping

允我心安 提交于 2019-12-11 00:01:48
问题 I wrote a little widget for Android devices. The widget uses AlarmManager to set recurring updates. I'm using the RTC clock for the AlarmManager . According to the documentation, if the device is sleeping, the RTC clock won't wake up the device and the next update will be when the device is woken. I have a log file for the widget which shows when it was updated. Even when I don't touch the device , I still see updates in the log file. Why is that? shouldn't the device be sleeping and thus my

How to get millisecond resolution from DS3231 RTC

a 夏天 提交于 2019-12-06 05:31:19
问题 How to get accurate milliseconds? I need to calculate the delay of sending data from Arduino A to Arduino B. I tried to use DS3231 but I cannot get milliseconds. What should I do to get accurate milliseconds from DS3231? 回答1: The comment above is correct, but using millis() when you have a dedicated realtime clock makes no sense. I'll provide you with better instructions. First thing in any hardware interfacing project is a close reading of the datasheet. The DS3231 datasheeet reveals that

How to get millisecond resolution from DS3231 RTC

那年仲夏 提交于 2019-12-04 10:29:48
How to get accurate milliseconds? I need to calculate the delay of sending data from Arduino A to Arduino B. I tried to use DS3231 but I cannot get milliseconds. What should I do to get accurate milliseconds from DS3231? The comment above is correct, but using millis() when you have a dedicated realtime clock makes no sense. I'll provide you with better instructions. First thing in any hardware interfacing project is a close reading of the datasheet. The DS3231 datasheeet reveals that there are five possible frequencies of sub-second outputs (see page 13): 32 KHz 1 KHz 1.024 KHz 4.096 KHz 8

how to wakeup android phone from sleep?

霸气de小男生 提交于 2019-12-04 02:09:34
How to wakeup android phone from sleep (suspend to mem) programmably? I don't want to acquire any wakelock, which means the phone goes into "real" sleep with the cpu disabled. I guess I can use some kind of RTC (real time clock) mechanism? Does anyone have any examples? Thanks. In order to let the Activity wake up the device and not require a password/swipe, you only need to add a few flags. To get that, include to your code: this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED