2 digit LED counter with buttons!

Hello all! This is my first post! :D I am new to the Arduino and my code is not working. I want to create a 2 digit led counter using the Arduino, but I am having trouble. First of all, I am going to take the Arduino outputs and hook them up to transistors to power a 12V light strip (this works I tested it). My first problem is that uses all 14 digital imputs (2, 7 seg displays). So could I hook up the + and - buttons to analog imputs? Second, my code uses all if statements and does not work at all. Does someone have code already that could work for this, or should I upload my code to see if we can get it to work? Thanks so much! Happy coding!


Hello man

Yes, the analogic pins can be used as digital ones, using for example "digitalRead(A0)". But I think that you should look for the CD4511 IC's, it's a useful IC to control 7-seg displays, using just 4 pins of Arduino to control a display. Or you can even use a shift-register(74HC595), that uses only 2 pins from arduino to control any number of displays(cascading IC's), but it's a little bit more difficult to code for begginers.

It's good that you post here your code so we can look at it and help you ;)