title: Passing variables with continuous functions?
body: <p>I am using a function to read an analog value from a joystick and update the label on the tkinter screen. This works well but I also want to use that value outside the function to perform if statements with other returned values. Here is what I have so far:</p>
  
  <pre><code>def joystick():
      global joystick_adc
      joystickRead = readadc(joystick_adc, SPICLK, SPIMOSI, SPIMISO, SPICS)
      joystickValue = joystickRead
      joy_val.config(text=joystickRead)
      joy_val.after(1000, joystick)
      return joystickValue
  </code></pre>
  
  <p>After it is returned I am assigning it to a variable using:</p>
  
  <pre><code>joystickVal = joystick()
  </code></pre>
  
  <p>But it only returns the value once and not continuously like I had hoped. Is there something I am doing wrong here??</p>