Stopwatch Can't Stop help please

Sorry for the description can’t figure how else to describe what I’m trying to do. I am trying to create a button that when held for x amount of time will rapidly ram up numbers and stop when released. Everything works fine except I can’t seem to get it to stop counting up. I have tried using clock and square wave generator. Any ideas will be greatly appreciated.

If I’ve understood correctly, you’re looking for something like this:
Screenshot 2021-04-29 at 15.38.57

For a simple stopwatch you could use:
Screenshot 2021-04-29 at 15.40.27

Hope this helps.

1 Like

Thank you for your help so far. I have almost figured it out but have one problem Left to solve and could do with some help on this one. So as I stated before I need to be able to press and hold the button to ramp up the counter and then let go on the button to get it to stop ramping up the account.This part works as intended but I need to be able Use the same button to increase the counter by 1 when using it as if you would normally connect the button directly to the counter I.E each time you press the button quickly (faster than the delay) increase the counter by 1.The problem I have when trying to incorporate this feature I believe it’s inverting my hip flop and I don’t know how to get around this. Any help will be greatly appreciated.

I’m also trying to make one. A little flaw to overcome.

Algunos trucos que hay que aprender a usar, Por lo que entiendo Quieren trabajar en más de un modo de trabajo. Si es así

mmmm, Que problema. Quiere darle dos modos de trabajo distinto a al mismo botón. Es posible. pero la mejor solución dependerá de la aplicación que usted ve quiera dar a este cronómetro.
Para Seleccionar modos de trabajo, xod/core/gate es muy bueno.

Let me translate.
From what I got he’s saying the best way to solve this would depend on what exactly you’re using it for. To select between the two different modes in the same button, xod/core/gate could work.

@eqs-aruy Hasta ahí bien, pero cuál sería el problema que decís?

1 Like

Hi @franco-scev .
El problema puede estar en el momento de discriminar el modo de cuenta continua o el modo de pulsar y contar.
Hay un fenómeno de que le llamamos Rebote cuando hacemos eso. Xod nos da una solución para esto
Los dos problemas mas probables puede ser perder algunas pocas cuentas en el modo continuo hasta que detecte el modo correcto.
El otro problema es que por efecto de revote tengamos alguna cuenta de más en el modo pulsar.
El problema es de error en las cuentas.

Ok, I got that. So there is a problem called bounce (might be a different name in English) when trying to differentiate between the holding mode and the click mode.
It’s possible it’ll skip some numbers while holding it until it detects the right mode. And you could also get some extra numbers on a click.
@floyd2282 @giligilipappa You’ll have to decide where your main problem is and how precise you need it to be so we can come up with a solution.

1 Like

my stopwatch working perfectly and the way I wanted. Just one thing when I wanted to reset the timer and flip-flop is “false” state it starts the counting then resets after 2 seconds whereas when it’s in “true” state it just resets after 2 seconds the way I wanted.

@giligilipappa I’m being told you can try replacing saw-wave for xod/core/clock. We’re still checking your patch.
Does it happen on simulation or on the controller?

on Controller. I’ve tried using gate after/before flip-flop but no luck. In realtime scenario stopwatch stops counting if I intend to reset and it does when flip-flop is in “true” state.

Can you put this on github? @eqs-aruy is offering to help out.

1 Like

Ok, juntos busquemos llegar a un partch que logre hacer esto. Seguro que @franco-scev nos ayudará a que el patch tenga buena documentación en español e inglés. Trabajemos en equipo. :wink:

How about this?

If delay timer is active, get pulses from button (via pulse-on-true node); otherwise, get pulses from clock, which only pulses when button is pressed. You’ll need appropriate values for delay-T and clock-IVAL.

This should have same affect:

The clock only pulses when delay is not active and button is pressed. puls… is a pulse-on-true node.

Either of these options might have an off-by-one error indicating a ‘defer’ node is needed to hold back a pulse long enough for other logic to stabilize. If 1st option does not register 1st button press, add defer node between button and if-else (could be before or after pulse-on-true node). If second option adds two on 1st button press, add defer node between button and ‘and’ node so delay-ACT is disabling clock before button press enables clock.


Se ve muy buena esta Solución.
Para intervalos que estén en el orden de 100ms o mayores, estimo que algo así debe ser una solución muy adecuada.
Hay que ver si realmente es tan critico los pequeños errores de conteo, y lo que se está buscando es dar un valor de seting de a pasos y continuo hasta llegar a un valor deseado.

Works like a charm. once again thank you very much.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.