Introduction: Arduino 7 Segment (5011BS, Common Anode or Cathode) Tutorial

We are going to make this thing work! Common cathode or Anode.

Step 2: Connect Pins 3 & 8 to Power (common Anode) or Ground (common Cathode)

Use a 330 resistor, 1k makes the led's too dim. Scream 'power' in the vein of Clarkson while completing this step. (Important)

Pins 3 and 8 are the center pins top and bottom.

Step 3: Flash the Arduino for Calibration.

Download the Seven Segment library and install to the Arduino IDE.

https://github.com/DeanIsMe/SevSeg/archive/master....

To install it, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library, then select the SevSeg ZIP file that you downloaded.

Now we need to flash the Arduino to print the number 8 with a dot so that we can connect her up.

code:

```#include "SevSeg.h"SevSeg sevseg; void setup(){
byte numDigits = 1; //we are using a single digit display
byte digitPins[] = {}; //leave empty for a single digit display
byte segmentPins[] = {1, 2, 3, 4, 5, 6, 7, 8}; //choose any 8 pins
bool resistorsOnSegments = true;
byte hardwareConfig = COMMON_ANODE;
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
}void loop(){
sevseg.setNumber(8, 0);  //Print 8, 0 means Decimal point is active, 1 turns it off.
sevseg.refreshDisplay(); //Needed to continue displaying the number
}```

Step 4: Now Let's Start Calibrating. (Segment A, Arduino Pin 1, LED Pin 7)

Now, we are going to calibrate from A-DC in order, one by one.

Look at this code, it's alphabetical from A-DC.

We are telling the Arduino that:

pin1 = A,

pin2 = B,

pin3 = C

...

pin8 = DC.

So now, connect segment A to pin 1. (pin 7 on the LED )

`byte segmentPins[] = {1, 2, 3, 4, 5, 6, 7, 8}; //choose any 8 pins`

Step 13: Make a Counter to Show Off Your Technical Prowess.

Copy & paste like it's hot, we are just tweaking the main loop.

```void loop(){  for (int i = 0; i<10; i++){
sevseg.setNumber(i, 0);
sevseg.refreshDisplay(); //Needed to continue displaying the number
delay(1000);
}
}```