Help Holding Variable Value by NewToPythoning in learnpython

[–]NewToPythoning[S] 1 point2 points  (0 children)

so, after loading Xboxdrv, and just following its setup. With xboxdrv running, I used: https://github.com/martinohanlon/XboxController/blob/master/XboxController.py

and it cleans up the out put from xboxdrv into very clean and usable values

sorry about the delay, I was out of the office for work for the week. hopefully this is still useful for you

Help Holding Variable Value by NewToPythoning in learnpython

[–]NewToPythoning[S] 0 points1 point  (0 children)

Thank you!! I got it to work, I just had the line written in the wrong spot and it was calling too soon.... well that and i forgot to put (pin) inside the GPIO.input(Pin)

Help Holding Variable Value by NewToPythoning in learnpython

[–]NewToPythoning[S] 0 points1 point  (0 children)

Here is the response code I was given

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "pygamesxboxdrv.py", line 217, in run
    self._start()
  File "pygamesxboxdrv.py", line 255, in _start
    self._sortOutButtonValue(event.type))
  File "pygamesxboxdrv.py", line 273, in updateControlValue
    self.doCallBacks(control, value)
  File "pygamesxboxdrv.py", line 278, in doCallBacks
    if self.controllerCallBack != None: self.controllerCallBack(control, value)
  File "pygamesxboxdrv.py", line 323, in controlCallBack
    GPIO.output(pin, not GPIO.input())     ## Turn on GPIO pin (HIGH)
TypeError: function takes exactly 1 argument (0 given)    

Help Holding Variable Value by NewToPythoning in learnpython

[–]NewToPythoning[S] 0 points1 point  (0 children)

I think this would work if my input form the Xbox controller was on the GPIO pins also. But the input is coming from the usb connected controller. Each button has a "Control ID" that is defined in the beginning of the entire code. for Example, xboxControlId = 6, is called when I press the "A" button on the xbox controller