     var green: CGFloat = 0.0
     var blue: CGFloat = 0.0
     var timer = NSTimer()
+
     
     override func viewDidLoad() {
         super.viewDidLoad()

        
        
        
//        
//        SocketConn.openStreamAndSendValues(flagDirectionX, flagY: flagDirectionY, speed: speed, direction: angle)
    }
    
        let bounds = CGRect(origin: CGPoint.zero, size: size)
        let opaque = false;
        let scale : CGFloat = 0;

        
        self.SocketConn = SocketConnection()
        
       
        
        
        //
        //        var timer = NSTimer.scheduledTimerWithTimeInterval(0.05, target: self, selector: Selector("updateJoystickCoordinates:"), userInfo: nil, repeats: true)
        
        self.timer = NSTimer.scheduledTimerWithTimeInterval(0.05, target: SocketConn!, selector: Selector("sendValue:"), userInfo: joystick, repeats: true)
        // Do any additional setup after loading the view, typically from a nib.
        
    }
    
    override func viewDidDisappear(animated: Bool) {
        print("view disappeared")
        self.SocketConn!.closeStream()
        self.timer.invalidate()
    }
    
    override func didReceiveMemoryWarning() {
