Instead of declaring two identical methods, you should use arrays and create one method which takes an index to the arrays. Your debounce code is overcomplicated and hard to understand since a lot of code is missing. But one one of your problems is that you need to check the debounce time in the first "if" - when the second "if" is executed, "lastDebounceTimeX" will always be very close to the value of "millis()" since that is what it has just been set to in the first "if".
Danois90:
Instead of declaring two identical methods, you should use arrays and create one method which takes an index to the arrays. Your debounce code is overcomplicated and hard to understand since a lot of code is missing. But one one of your problems is that you need to check the debounce time in the first "if" - when the second "if" is executed, "lastDebounceTimeX" will always be very close to the value of "millis()" since that is what it has just been set to in the first "if".
I've posted the full code for the project if that helps to understand more, if it's still not worth it, what would be a better way to do it
You've apparently pasted your debounce functions into the middle of the setup function. There are other changes from the code you initially posted that aren't helping either, but I'd suggest that you fix the first problem & take another look.
So I guess that you have copy-pasted some code from the interweb which does not work and now you want the arduino forum to fix it for you? Please hire a programmer or try in gigs and collabs.
Danois90:
So I guess that you have copy-pasted some code from the interweb which does not work and now you want the arduino forum to fix it for you? Please hire a programmer or try in gigs and collabs.
that was kinda uncalled for.
ive got everything else working except the debounce. as far as i can see code wise.
no need to sound snappy. ive never used debounce before and thats why i turn to the forum for help.
and yes the debounce function is copied but that shouldnt really matter if i could get it to work.