Arduino Uno 7 segement help

Thread Starter

DannyKemp

Joined Jun 23, 2014
16
Hello everyone for a basic project i wanted to create a basic circuit with the UNO and a 7 segement LED Display (common anode) i will like to a have a simple push switch that works like a simple counter with the LED display so everytime i press it the numerical value goes up by 1 on the display. As im still learning the basics can anyone help me out with the wiring setup and the code i need to get this to work?
 

pwdixon

Joined Oct 11, 2012
488
Easiest would be to wire the common anode to the positive rail and the segment LEDs via suitable resistors to 7 output pins. Wire a button and a pullup resistor to another processor input pin for an increment button.

The code would be check input button for press increment a count then work out the translation of count to individual segments energised and drive those segments low to turn on the segment LEDs.
 

djsfantasi

Joined Apr 11, 2010
9,163
Also, a little more complicated hardware but simpler software is to use 4 pins for BCD and a 4511 BCD to 7 segment decoder.

This way, you don't have to decode which segments for which number in your code.

Just as aside, you do realize you'll have to debounce your push switch?
 
Top