For Loop - Hardware Only
HackMakeMod HackMakeMod
67.4K subscribers
33,573 views
0

 Published On Mar 16, 2024

In programming, a 'for loop' executes operations a predetermined number of times.… Like blinking an LED five times when I press this button.

Do you think we can build this with just hardware and no software?

Of course!
We just need the help of some classic transistors and integrated circuits.

First we need an SR Latch built from two transistors. This holds a binary state and changes it based on input signals. This will turn the sequence on, when the button is pressed, and then off after the set number of cycles complete.

Next we need a 555 timer to work as an oscillator creating the pulses.

We can set the timing based on the resistors and capacitor we use.

Finally we’ll feed these pulses into a decade counter. This integrated circuit advances by one count with each pulse. We’ll add a wire to the 5th count output, sending the signal back to the SR Latch, and stopping the sequence.

Simultaneously the same output will be sent to the reset pin on the decade counter.

So now, when I push the button the LED blinks five times and then stops automatically.

Both the 555 Timer and the 4017 Decade counter were introduced over 50 years ago! And they are still being used today!

#forloop #coding #hardware #555timer
#DecadeCounter
#arduinoprojects

show more

Share/Embed