19,676 questions
4
votes
2
answers
148
views
How to call a composable function after a certain time in Jetpack Compose?
When my application starts, I launch an animation. Now I would like to switch to another component (navbar) after 30 seconds. In my research, I saw that the delay function from the Kotlin Coroutines ...
4
votes
4
answers
343
views
Task.Delay versus custom DispatcherTimer-based delay in WPF
I have a WPF project, and in some of the async event handlers in the WMain.xaml.cs I am using the Task.Delay method to suspend the execution of the handler. Example:
private async void Window_KeyDown(...
2
votes
1
answer
108
views
Timer 0 macro constants for Microchip PIC18F8722
I am using MPLAB X IDE version 5.43 to develop an embedded project for a PIC18F8722 microcontroller.
It has a timer TMR0 which can be configured to be 32 bits.
I had lots of statements:
TMR0L = 0;
...
0
votes
0
answers
68
views
Is there a way to have the timer override the prompt input?
I'm trying to make a terminal quiz that has a timer running in the background while you answer the question, which, once finished, overrides the input if it hasn't been filled.
I've tried putting the ...
1
vote
1
answer
77
views
STM32L010C6 TIM2 IRQ priority, over capture vs edge detection, classic timer issue
So I want to use a capture compare to measure an input frequency 0.1 Hz to 100 kHz.
The peripheral clock is set to 32 MHz to cover the full range and maximise the speed of calculations.
At lower ...
0
votes
2
answers
85
views
countback from date is negative, how to make numbers positive? [closed]
i am trying to use a countback from a certain date, and want it to read something like (100d, 10hrs, 10sec). the countback does this fine, except it reads as (-100d, -10hrs, -10sec). is there a way to ...
0
votes
1
answer
117
views
Excel VBA code "Application.OnTime" skips seconds
I have a timer within Excel VBA code which did run smooth untill 6 weeks ago. Please see the code below. I use this timer in a workbook. I use 2 identical copies of this workbook (with different names)...
2
votes
1
answer
56
views
stm32f103c8t6 timer 1 pwm outputs not working
I'm working on a project that needs 3 pwm outputs. I'm already tried with timer 2,3,4, and they work fine with my library. But I wanted to port my pwm library to timer 1 and now I see that A8, A9, A10 ...
1
vote
0
answers
48
views
Very Specific Combination of Servo.write and analogWrite messes up frequencies on esp32 PWM pins
Preface: First time asking a question, please take it easy with the "YOU SHOULD FORMAT YOUR QUESTIONS THIS WAY!"
Question: Why does this happen?
I'm programming an esp32 S3 dev module using ...
0
votes
0
answers
57
views
Simplest timer in C [duplicate]
I am trying to make the simplest timer program in C. My attempt is as follows:
#include <stdio.h>
#include <time.h>
int main()
{
char c;
time_t start, end;
long int day, ...
1
vote
0
answers
105
views
C++ thread timer function with consistent timing on Windows?
I am trying to build a cross-platform threaded timer function in C++. Here is what I have so far (posted also in Statically linked pthread and terminate called after throwing an instance of 'std::...
1
vote
1
answer
141
views
Need Help Getting a Hardware Timer on an ESP32 to Start and Stop and Then Restart on a Trigger
I am trying to get a hardware timer in an ESP32 to start and stop based on states in a FSM.I have read quite a few ESP32 Timer Howtos, and I am still not getting it to work.
The timer functions ...
-1
votes
1
answer
66
views
I am trying to stop inputtimeout in pycharm but i don't know how
My code is:
import random
from inputimeout import inputimeout, TimeoutOccurred
# todo inputs
b = input("press enter to start")
lowest_numb = input("lowest number")
...
1
vote
0
answers
52
views
TTimer inside TTask does not run in Delphi
I have a Delphi 12 app that launches several threads that execute a task, that is, the same task repeated in N threads, there are no critical sections, no blocking or any other complications. Inside ...
2
votes
2
answers
381
views
STM32G4 TIM1 center aligned PWM update event problem
I'm facing an issue with the update event triggering in STM32G4 TIM1. I've configured TIM1 to generate PWM signals and set the update event to Center-Aligned Mode 1. However, I've noticed that the ...
0
votes
1
answer
159
views
Timer is not ticking when message box is open
I have an inactivity timer that keeps checking for inactivity throughout the app. The problem is, when message box is open, the timer is not ticking and checking for inactivity as long as the ...
1
vote
0
answers
85
views
Thread crash during boost::yield inside catch block
I'm currently investigating a crash scenario that is caused by performing a Boost yield inside a C++ catch block. Here's a minimal reproducible example that leads to a crash.
Notice the following ...
0
votes
0
answers
30
views
Flutter: Multiple timers losing precision after screen lock/unlock
Problem
I'm developing a Flutter application with multiple simultaneous timers. These timers need to keep running correctly even when the user:
Navigates away from and back to the page
Closes and ...
1
vote
1
answer
62
views
STM8 Timer1 glitch or stalling issue
Timer error 1 in STM8S003F3P
I am writing code to create overflow 1s = Timer 1 to reduce the remaining_sec variable from 60 to 1. But the Timer often hangs for a while at random times.
For example, ...
0
votes
1
answer
63
views
How to create a 24 hour timer?
I want to create a 24 hour sale timer and display it inside button. I am using this code but don't know how to stop this timer.
This is my code. In this example I use 35 second to test this faster:
...
1
vote
2
answers
95
views
STM32F427 controlling TIM4 channels (PWM) with signle DMA stream
I am trying to control all 4 TIM4 pins for PWM signal using DMA. Can I send data to each pin with single DMA stream ?
When I setup the pins and DMA in STM32 IDE it links the TIM4 Channel 1 pin to DMA1 ...
0
votes
0
answers
72
views
Why is my Timer class not executing when started consecutively with no delay?
I have a custom Timer class in C++ that uses std::async to run a timer in a separate thread. The problem I'm facing is that when I call start() on the same Timer object consecutively with no delay, ...
1
vote
2
answers
116
views
Why is increasing the "resolution" of a timer actually decreasing accuracy?
The central part of my App is a timer. Thus far this was the Code (taken out of the main Codebase to be minimum reproducible):
import SwiftUI
struct TestView: View {
@State var countdownTimer = ...
0
votes
0
answers
56
views
watchOS timer app freezes UI in dimmed state while haptics continue working
I'm working on a watchOS timer app that needs to run for 3 1/2 minutes while showing countdown numbers. I think that I've discovered that there's nothing to do with the watch dimming- that's a system ...
1
vote
1
answer
153
views
Rust timer not triggering after the specified timeout
I am having some problems with timers: I cannot identify the reason why this is not working properly:
use std::sync::{Arc, Mutex};
use timer::Timer;
struct Counter {
value: i32,
}
impl Counter {...