The essential circuit of both of the presentation is same the main distinction as demonstrate by the innocence of each is that one is regular anode with the information signals proposed to applied on cathode pins and other is basic cathode with information signals applied on the anode pins of the showcase. The pinout of the Seven Segment Display is appeared in the figure underneath:
As spoke to in the figure each LED in the Seven Segment Display is indicated by the Alphabets a to g. These LEDs are turned on in the specific way to show any numeral from 1 to 0. As likewise spoke to in the figure these LEDs are constrained by the Pin numbers indicated for each LED.
The idea of the regular anode can be found in the accompanying figure:
https://forum.arduino.cc/index.php?action=dlattach;topic=675269.0;attach=355402
void setup() {
// define pin modes
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
}
void loop() {
// loop to turn leds od seven seg ON
for(int i=2;i<9;i++)
{ digitalWrite(i,HIGH);
delay(600);
}
// loop to turn leds od seven seg OFF
for(int i=2;i<9;i++)
{ digitalWrite(i,LOW);
delay(600);
}
delay(1000);
}