title: Reading joystick values with Python
body: <p>I want to read the values of an Logitech Logitech Extreme 3D Pro with a Raspberry Pi. I'm using the <a href="http://www.pygame.org/docs/ref/joystick.html" rel="nofollow noreferrer">pygame library</a></p>
  <p>The script:</p>
  <pre><code>import pygame
  import sys
  import time
  
  pygame.joystick.init()
  
  print pygame.joystick.get_count()
  
  _joystick = pygame.joystick.Joystick(0)
  _joystick.init()
  print _joystick.get_init()
  print _joystick.get_id()
  print _joystick.get_name()
  print _joystick.get_numaxes()
  print _joystick.get_numballs()
  print _joystick.get_numbuttons()
  print _joystick.get_numhats()
  print _joystick.get_axis(0)
  </code></pre>
  <p>The ouput:</p>
  <pre><code>1
  1
  0
  Logitech Logitech Extreme 3D Pro
  4
  0
  12
  SDL_JoystickNumHats value:1:
  1
  SDL_JoystickGetAxis value:0:
  0.0
  </code></pre>
  <p>There are 4 axes and I turned all of them.</p>
  <p>I can't find the problem. I already tried using other axes.</p>
  <p>Thanks for help.</p>