I am interested in implementing an adjustable timer, since each time a button is pressed, the time period shoud increment. I am controlling a led strip through Arduino Uno, and the leds are turned on sequentially up and down, during ts seconds.
If an external push button is pressed, the value of ts should increment from 1 to 2, or from 2 to 3, and so on. Therefore, I need to implement this through interruptions.
I've already used the timerOne library, but it just works with a fixed time.
Which solutions do you recommend me for setting the timer through the external button, please?
Thanks!
Fernando
Do not hijack. Thread split.
There are some relevant sketches in the Arduino playground
fmarengorodriguez:
If an external push button is pressed, the value of ts should increment from 1 to 2, or from 2 to 3, and so on. Therefore, I need to implement this through interruptions.
If by "interruptions" you mean interrupts, then you are mistaken. There is absolutely no need to use interrupts to determine that a button has been pressed. You will, however, need to learn about a thing called "debouncing".
Also, if you would like help with code, it would be a big help to us if we could see the code you already have. (It's hard for us to fix what we can't see!)
When you post your code, please use code tags.