Advice!
Posted: Sat Sep 21, 2024 4:56 pm
Hi all!
I am making a project where I use PWM. I want to adjust the timing with two button. I call these two button by help of pin interrupt to toggle up and down. I in/de crement by one (in the calculation DelayAjd = DelayAjd - 1 and DelayAjd = DelayAjd + 1 But every time I press one of the button the counters step up and down with two? If I change cslculation with 2 it change with 4 ?
Works in simulation. My loop in the interrupt I use for "delay" timer to avoid noice. I know it is not good to use delay component in macro called by interrupt.
Plaese, what am i doing wrong?
Br jorgen
I am making a project where I use PWM. I want to adjust the timing with two button. I call these two button by help of pin interrupt to toggle up and down. I in/de crement by one (in the calculation DelayAjd = DelayAjd - 1 and DelayAjd = DelayAjd + 1 But every time I press one of the button the counters step up and down with two? If I change cslculation with 2 it change with 4 ?
Works in simulation. My loop in the interrupt I use for "delay" timer to avoid noice. I know it is not good to use delay component in macro called by interrupt.
Plaese, what am i doing wrong?

Br jorgen