Questions tagged [real-time-clock]

Quoting Wikipedia:

A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that keeps track of the current time.

Micro controllers, Android, related assembly (or low-level) code are concepts that usually accompany so make sure you pick the right one.

199 questions
0
votes
1 answer

Synchronizing TWEEN, CCapture, and THREE.js rendering code to all be on the same clock

I'm using a library called CCapture to capture equally time-spaced frames. This code seems to be able to hook the clock and control it so that is slows down my rendering loop when it is capturing. My code uses clock.getDelta() to get the time and it…
phil1008
  • 39
  • 4
0
votes
1 answer

How can I calculate the difference between two timestamps using micropython?

I have a raspberry pi pico and a DS3231 real time clock hooked up to it. I'm able to receive the current time in BCD and format it in a string by Hours:Minutes:seconds "00:00:00" using the DS3231 sample code that has been provided from the…
0
votes
1 answer

What is the device at 0x68 on I2C2 of Google Coral?

I am trying to connect an external RTC (addr 0x68, on Witty Pi 3) to my Google Coral dev board on I2C2 (bus 1). But i2cdetect shows a device at 0x68 even without my external RTC connected. I can't find anything in the docs (SOM or dev board) about a…
Mark
  • 1
0
votes
1 answer

BalenaOS use Raspberry Pi Compute Module 4 IO board's Real-Time Clock inside container

I'm trying to use the CM4 IO board's Real-Time Clock (RTC) to persist datetime changes from within a docker container, so whenever the device reboots, it remembers the newly set datetime. (By default it syncs via chrony.) I can update the system's…
Nico V
  • 107
  • 1
  • 9
0
votes
1 answer

why is my minute hand and hour hand not showing up during execution with css and js

const secondHand = document.querySelector('.second-hand'); const minsHand = document.querySelecetor('.min-hand'); const hourHand = document.querySelector('.hour-hand'); function setDate() { const now = new Date(); const seconds =…
0
votes
1 answer

Strange Issue with STMF407 RTC - only counting once, but counting regularily when Breakpoint is set

I have a strange issue with the RTC of an STM32 F407 in one of my projects. Abstract: The function HAL_RTC_GetTime(...) updates the output value only once, then remains at the same valule, but it updates if I set a breakpoint in this…
Chris_B
  • 359
  • 5
  • 13
0
votes
1 answer

Removing seconds from Live clock using JavaScript

I was wondering if it is possible to remove the seconds group in a live clock made with JavaScript. Ive been tinkering with it for a while now and have not been successful so far. Any advice or guidance well be gratefully welcomed. Here's what I'm…
Alex
  • 29
  • 6
0
votes
0 answers

How to signal between process/containers in cpp in efficient way?

Background: We have a clock process which needs to signal other non child processes[cpp code] on each clock tick. Each of the process lives in its on container (containerd). Besides doing brute force of scanning a shared memory on a change(which is…
oak
  • 2,898
  • 2
  • 32
  • 65
0
votes
1 answer

What is wrong with clock_gettime with CLOCK_REALTIME?

Consider the following code: struct timespec ts; uint64_t start_time; uint64_t stop_time; if (clock_gettime(CLOCK_REALTIME, &ts) != 0) { abort(); } start_time = ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec; /* some computation... */ if…
DaBler
  • 2,695
  • 2
  • 26
  • 46
0
votes
0 answers

React - Live Clock Doesn't Work With Initial Value Different Than 0

I am trying to build a live clock with react for a weather app that will update the time in real time instead of only while refreshing the page. I managed to update the clock in real time but the problem is that it works only when initial value in…
Idanref
  • 169
  • 1
  • 1
  • 9
0
votes
1 answer

mktime() returns an incorrect value right after entering DST

The following snippet code is from rtc.c in busybox-1.22.1. In my case the utc is always 0, so this function is just doing a conversion from struct tm to time_t. time_t FAST_FUNC rtc_tm2time(struct tm *ptm, int utc) { //fprintf(stdout,…
0
votes
0 answers

How to convert RDTSC Clock ticks to Real Time in C or C++?

This is the code I am using in C to convert RDTSC clock ticks to time in usec. Assembly code to read the TSC. To covert RDTSC clock ticks to time, need to divide it with CPU clock frequency in GHz. CPU Frequency = 0.963 is in GHz. I don't know where…
Sobia Rind
  • 61
  • 1
  • 3
0
votes
1 answer

Analog Clock's Hands not Working Properly

Something is wrong in java script section of the code The hour hand is not working properly. It is rotating after every 60 seconds. Also, the minute hand is showing the wrong time. Please check the formula written in js. The formula I have used was…
Diksha
  • 23
  • 1
  • 8
0
votes
1 answer

formet in 24 hour inn clock function

Hello every one I am writing a abir John and want to find the clock Javascript file That's code add in javascript file then link in index.html file function clock(){ var hour = document.getElementById('hour'); var minute =…
Abir John
  • 1
  • 1
0
votes
1 answer

When I print this python code , only the first code gets executed. please help me fix this issue

# code 1 import time while True: from datetime import datetime print(" Time: "+ "%d:%d:%d " % (datetime.now().hour,datetime.now().minute,datetime.now().second), end = "\r") time.sleep(1) # code 2 name = input("Your good name…