         self.egpio = gpios[4]
         self.fgpio = gpios[5]
         self.ggpio = gpios[6]
-        self.agpio.direction = .OUT
-        self.bgpio.direction = .OUT
-        self.cgpio.direction = .OUT
-        self.dgpio.direction = .OUT
-        self.egpio.direction = .OUT
-        self.fgpio.direction = .OUT
-        self.ggpio.direction = .OUT
+        self.gpios.forEach { (gpio) in
+            gpio.direction = .OUT
+        }
     }
     
     // MARK: Private methods

    // MARK: Public methods
    
    func displayDigit(_ digit: Digit) {
        switch digit {
        default:
            switchSegment(.a, to: 1)
        }
    }
    
    
}

            fatalError("There should be 7 gpios for the one digit segment display")
        }
        
        self.gpios = gpios
        self.agpio = gpios[0]
        self.bgpio = gpios[1]
        self.cgpio = gpios[2]
