Example code to control a 7-segment display with 4 digits and 12 pins using an Arduino.
ATTENTION: This code works with a common cathode display. If you want to use a common anode display, change "low" to "high" and "high" to "low" in the code.
Use 220 or 330 ohms resistors in the pins to protect your display.