Cancel loop and repeat code

Hi,
today more parts came in. So today I did some electrical work today and less programming.

I do agree with you. I started this project because I wanted to learn something new.

I was reading into Debouning. I still don't quite get the concept. But I will defienlty read into it.

Also a big thank you @StefanL38. This actually helped me a lot!
I tried your code and it pretty much does what I want it to do. Right now I'm adding and modifying your code. Dankeschön :wink:

I will definitely create a new thread in "Exhibition / Gallery category" when I'm completely done and present to you my work!

here is a link that explains what is happening and how it can be solved in software.

best regards Stefan

Debouncing is one of those funny things you come across early in your arduino journey. Basically the intuitive idea of a button is that you press it and it changes state from 1 to 0 or vice versa. In fact, due to the magic of electrickery when you press a button it actually ‘bounces’ back and forth between 1 and 0 many times in a few milliseconds as the contacts are closing. The microcontroller is so quick that, unlike a human, it detects this and will switch the associated load off and on seemingly at random.

So, you need to learn to detect the initial press of a button, it’s change in state, and wait until a few milliseconds have passed to see it it remains in this state beyond the normal bouncing time. A simple solution is just to stick a dirty big delay in immediately after the button state change has been detected but this is frowned upon for good reason and you must resort to the same millis timing that the blink without delay encourages

Hi, take a look at the LH595 shift register demo's.
You can send a binary code to the register and control 8 lights through just 3 output wires.
once you figure that out you'll find you can control the lights a whole lot easier.
and when you get that, put two LH595's together to control 16 lights etc etc.
And then you can have a whole Xmas light setup :slight_smile:

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