View Full Version : 2 sliders from 1 joystick (Logitech G25)
moneim230
12-29-2009, 02:43 PM
Hello all,
i'm using Logitech G25 steering wheel in my code and i have a problem.
i have all the signals from it except the clutch pedal
when i use "vizjoy.getSliderCount()" it returns 2 which mean i have 2 sliders
but when i print the value of the slider i get postive values from the gas pedal and negative values from the breaks pedal...Does this mean that the gas and the breaks pedal are one slider ??? (+ve for breaks , -ve for gas)
if that is right...how to get the 2nd slider value ?
moneim230
12-29-2009, 04:47 PM
here is a code i created to get signals from the G25 steering wheel:
import viz
import vizjoy
viz.go()
G25=vizjoy.add()
def button(state):
state = G25.getButtonState()
print 'Button State = ',state
def joymove(x):
x=G25.getPosition()
print 'Position = ',x
def twistvalue(x):
x=G25.getTwist()
print 'Twist = ',x
def slidervalue(x):
x=G25.getSlider()
print 'Slider =',x
def hatangle(x):
x=G25.getHat()
print 'Hat=',x
print 'Joystick name = ',G25.getName()
print 'Slider count = ',G25.getSliderCount()
print 'Button count = ',G25.getButtonCount()
print 'Hat count = ',G25.getHatCount()
viz.callback(vizjoy.BUTTONDOWN_EVENT,button)
viz.callback(vizjoy.MOVE_EVENT,joymove)
viz.callback(vizjoy.TWIST_EVENT,twistvalue)
viz.callback(vizjoy.SLIDER_EVENT,slidervalue)
viz.callback(vizjoy.HAT_EVENT,hatangle)
If you use the clutch pedal do you notice a change in the Z value when you print the position?
def showJoyPosition():
print 'position: ',joy.getPosition()
vizact.ontimer(0.1, showJoyPosition)
moneim230
01-07-2010, 11:47 AM
If you use the clutch pedal do you notice a change in the Z value when you print the position?
def showJoyPosition():
print 'position: ',joy.getPosition()
vizact.ontimer(0.1, showJoyPosition)
no Z value does not change
Only the value of X changes (+ve for steering right , -ve for steering left)
Y & Z are always zero :confused:
Are there different modes that you can put the G25 steering wheel in?
moneim230
01-14-2010, 04:01 AM
Are there different modes that you can put the G25 steering wheel in?
it works in 2 modes:
the first is manual gearing (6 speeds + reverse)
the second is sequential (step up , step down)
i use the first one but this has nothing to do with the clutch signal
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.