     public var state: NuimoConnectionState { get{ return self.peripheral.state.nuimoConnectionState } }
     public var batteryLevel: Int = -1 { didSet { if self.batteryLevel != oldValue { delegate?.nuimoController?(self, didUpdateBatteryLevel: self.batteryLevel) } } }
     public var defaultMatrixDisplayInterval: NSTimeInterval = 2.0
-    public var matrixBrightness: Float = 1.0
-    public var firmwareVersion = 0.1
+    public var matrixBrightness: Float = 1.0 { didSet { matrixWriter?.brightness = self.matrixBrightness } }
+    public var firmwareVersion = 0.1 { didSet { matrixWriter?.firmwareVersion = self.firmwareVersion } }
     
     public override var serviceUUIDs: [CBUUID] { get { return nuimoServiceUUIDs } }
     public override var charactericUUIDsForServiceUUID: [CBUUID : [CBUUID]] { get { return nuimoCharactericUUIDsForServiceUUID } }
     public override var notificationCharacteristicUUIDs: [CBUUID] { get { return nuimoNotificationCharacteristicnUUIDs } }
 
-    private var matrixCharacteristic: CBCharacteristic?
-    private var currentMatrix: NuimoLEDMatrix?
-    private var currentMatrixDisplayInterval: NSTimeInterval = 0.0
-    private var isWaitingForMatrixWriteResponse: Bool = false
-    private var writeMatrixOnWriteResponseReceived: Bool = false
-    private var writeMatrixResponseTimeoutTimer: NSTimer?
+    private var matrixWriter: LEDMatrixWriter?
     
     public override func connect() {
         super.connect()

            writeMatrixNow()
        }
    }
    
    private func writeMatrixNow() {
        guard
            let ledMatrixCharacteristic = matrixCharacteristic,
            let currentMatrix = self.currentMatrix
            where !isWaitingForMatrixWriteResponse
            else { return }
        
        // Convert matrix string representation into byte representation
        let matrixBytes = currentMatrix.matrixBytes
        
        // Write matrix
        let matrixData = NSMutableData(bytes: matrixBytes, length: matrixBytes.count)
        if firmwareVersion >= 0.1 {
            let matrixAdditionalBytes: [UInt8] = [UInt8(min(max(matrixBrightness, 0.0), 1.0) * 255), UInt8(currentMatrixDisplayInterval * 10.0)]
            matrixData.appendBytes(matrixAdditionalBytes, length: matrixAdditionalBytes.count)
        }
        peripheral.writeValue(matrixData, forCharacteristic: ledMatrixCharacteristic, type: .WithResponse)
        isWaitingForMatrixWriteResponse = true
        
        // When the matrix write response is not retrieved within 100ms we assume the response to have timed out
        writeMatrixResponseTimeoutTimer?.invalidate()
        writeMatrixResponseTimeoutTimer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: "didRetrieveMatrixWriteResponse", userInfo: nil, repeats: false)
    }
    
    func didRetrieveMatrixWriteResponse() {
        isWaitingForMatrixWriteResponse = false
        writeMatrixResponseTimeoutTimer?.invalidate()
        
        // Write next matrix if any
        if writeMatrixOnWriteResponseReceived {
            writeMatrixOnWriteResponseReceived = false

    
    public override func didDisconnect() {
        super.didDisconnect()
        matrixWriter = nil
        delegate?.nuimoControllerDidDisconnect?(self)
    }
    
