ok, got it working! Thanks Steve. also added the pause and added a capacitor across the pushbutton to create an RC time constant and deal with the debounce.
You guys are so helpful on here!
ok, got it working! Thanks Steve. also added the pause and added a capacitor across the pushbutton to create an RC time constant and deal with the debounce.
You guys are so helpful on here!
you're welcome.
Actually you don't need the capacitor, the debounce is done by software.
Usually i choose 50mS as debounce delay.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
if you are scanning switches the capacitor dosent slow down your program "pauses and "button" command debouncing does.
some engineer told me many years ago the computer does as its told you are its master and superior
sure! but we talk about <50msec... even <20mSec. it's also depend what else your program is doing and how your program is done. Interrupt can happen really fast on some software.. slower on other. Always case by case.
PushButtons aren't 0-1 signal... still present some odd result when releasing them.
By software: We just check and insert a safe delay prior to return to the main program.
By using capacitor: it just smooth the signal when releasing the switch... the old CMOS-TTL-...-.... to do it. I prefer the software method in many case. No additional parts and even if you have the most crapy switch in the world, you just need to modify 1 code line OR constant variable. Handy with some tact switches brand...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks