 
     func stop() {
         if peripheral?.state == CBPeripheralState.Connected {
-            peripheral?.writeValue(ledButtonTag.Off.type, forCharacteristic: characteristicArray[4], type: .WithResponse)
+            peripheral?.writeValue(ledPattern.Off.type, forCharacteristic: characteristicArray[4], type: .WithResponse)
             ledPatternIndex = 0
         }
     }

    
    func play() {
        if peripheral?.state == CBPeripheralState.Connected {
            peripheral?.writeValue(ledPattern[ledPatternIndex].type, forCharacteristic: characteristicArray[4], type: .WithResponse)
            ledPatternIndex++
            if ledPatternIndex >= ledPattern.count {
                ledPatternIndex = 0
            }
        }

    var peripheral: CBPeripheral?
    private var characteristicArray = [CBCharacteristic]()
    
    private var ledPatternList = [ledPattern.Red,    ledPattern.Off,
                                  ledPattern.Yellow, ledPattern.Off,
                                  ledPattern.Green,  ledPattern.Off,
                                  ledPattern.Cyan,   ledPattern.Off,
                                  ledPattern.Blue,   ledPattern.Off,
                                  ledPattern.Purple, ledPattern.Off]
    
    private var ledPatternIndex = 0
    
    private enum ledPattern: Int {
        case Red, Yellow, Green, Cyan, Blue, Purple, Off
        
        private var type: NSData {
