View Single Post
  #1  
Old 02-04-2011, 01:19 PM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
2nd Analog Stick on Gamepad

We're using a Logitech Wirless Gamepad F710, the default code allows me to access all 12 button inputs and the left analog stick. (Sweet!)

But I'm trying to get input from the second analog stick, and I keep getting "WARNING: Failed to connect to joystick" in the console when I try to add the second one using the code below:
Code:
import vizjoy
#Add a joystick. This will return the first detected joystick
joy = vizjoy.add()
joy2 = vizjoy.add()

#Initialize global joystick position variable
joyPOS = [.00001,.00001]

#Record the position of the joystick in for use in onTimer function
def joyMove( e ):
    global joyPOS
    #Save position in global
    joyPOS = e.pos
   
#If the joystick position changed, call joyMove
viz.callback( vizjoy.MOVE_EVENT, joyMove )
Any suggestions?
Reply With Quote