

Then load up the following sketch onto your board.īefore you upload the code to your board, make sure you have installed the Arduin library – TimerOne.h. The green power LED (labelled PWR) should go on.Open the Arduin IDE and choose corresponding board type and port type for you project. The wiring between the 4-digit 7-segment display and the Osoyoo Basic board is as shown below:Īfter above operations are completed, connect the board to your computer using the USB cable. In this example we will use a 4-digit 7-segment display to make a stopwatch, you can see the number increases by one per second on the 4-digit 7-segment display. As our eyes can’t pick a change occurring repeatedly to any object within 1 second, what we see is 1234 appearing on the display at the same time. We repeat this process for next two numbers and switching between display units should be done very fast (about within one second delay). Then we send signals to show “2”, turn off 1st display unit and turn on 2 nd display unit. First we turn on the segments relevant to “1” and turn on the 1 st display unit. The human eye just visualizes all the 4 display units to be ON all the time. Due to persistence of vision, human eye can not differentiate between which display is ON/OFF. What multiplexing does is simple – show one digit at a time on a display unit and switch between display units very fast. So how we are going to display a number like 1234 on this 4 digit display? For this we are going to use a method called multiplexing. Also, this multiplexing technique turns the massive amount of microcontroller pins necessary to control a display into just eleven or twelve (in place of thirty-two)! This allows each digit to be turned on or off independently. And each of the four digits in the module have their own common cathode connection point. The other 4 pins represent each of the 4 digits from D1-D4.Įach segment in the display module is multiplexed, meaning it shares the same anode connection points. 8 of the pins are for the 8 LEDs on each of the 7 segment displays, which includes A-G and DP (decimal point). Pin Out – 4 Digit 7 Segment DisplayĪ 4-digit 7-segment LED display has 12 pins. Let’s see the pinout of this 4 digit 7 segment display.

We are going to use a different method to control this Four digit display.
#7 segment common anode how to#
Now we are going to see how to interface 4 digit 7 segment display with OSOYOO Basic board.


