help with - 2 digit 7 segment display and 2 74hc595

I don't think I understand.

No you won't and no one would expect you to be able to cope with such and advanced concept. It is just dhenry likes to show off how much smarter than the rest of us he is.

For what you are doing the code is just fine as long as you can understand it.
Later if you ever have a real application where you want to use this, then one way to rewrite the code is by using interrupt driven tasks. However before you get to that there are other ways to rewrite it.

At the moment you use delays to slow the display down so you can see it. In general delays are bad because they stop the processor from doing anything else. If you have other things for it to do then there are ways of removing the delays.
If you look at the blink without delay example in the examples menu you will see how this is done by looking at the millis() timer. In 899% of cases that will be sufficient, however for the 1% when it is not you have to use dhenery's solution. By the time you come to need that you will have a whole lot of experience to help you.

Remember you never attempt a triple back somersault before you can do a single one.

1 Like