title: Delaying a joystick IF statement
body: <p>My code consists of a joystick PyGame module that updates the variable self.mmcount when the left stick's vertical axis is moved. My issue is that it updates the mmcount variable too frequently that it's very hard to get to a specific integer. I presume the solution is to add a delay to the IF statements. For example, every two seconds check if the left stick is pointing up.</p>
  
  <p>These are the IF statements that update the self.mmcount variable:</p>
  
  <pre><code>if joy1.get_button(3) == 1:
      self.mmcount -= 1
  if joy1.get_button(2) == 1:
      self.mmcount += 1
  </code></pre>
  
  <p>Entire code:</p>
  
  <pre><code>class Menu:
      def run(self):
          self.intro = True
          self.clock = clock
          self.mmcount = 1
              while self.intro:
                  self.get_joys()
  
      def get_joys(self):
          if joy1.get_button(3) == 1:
              self.mmcount -= 1
          elif joy1.get_button(2) == 1:
              self.mmcount += 1
  
          if self.mmcount &gt; 3:
              self.mmcount = 3
          elif self.mmcount &lt; 1:
              self.mmcount = 1
  
  m = Menu()
  while True:
      m.run()
  </code></pre>