[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.713237 [View]
File: 2.67 MB, 2816x2112, DSC08332.jpg [View same] [iqdb] [saucenao] [google]
713237

Beginner here.
One of my first projects. Wiring took about 5h because I was doing it without any schematic, also I stripped the cables myself with sandpaper.
Code was the tricky part and took me more time, also because the Arduino IDE is shit.
Basically I used two 74HC595 shift registers to make an 8-segment 4-digit display work with my Arduino UNO.
It's a hexadecimal counter, adding 1 every second.
I used 5 nested fors in the code to make it work, one for the thousands, one for the hundreds, one for the tenths and one for the units.
The innermost for handles the multiplexing, basically inside each digit is written one after another with a 1ms delay() between each (which means 4ms total to write the whole 4 digit number once)
for 250 times, which makes one second. After that the number is increased by one and it starts over.
I'm gonna post the code here, though I don't know whether /diy/ supports the tag:
(continued in next post)

Navigation
View posts[+24][+48][+96]