Greetings ya all.
So I am using gamepad with 2 analog "sticks". I am sending that signal via USB to PC, and from PC via usb to PyBoard.
The program works, I'm using bytearray and that struct.pack/unpack. It's perfectly fine.
But some of the buttons cause Keyboard Interrupt. Is it possible to turn the interrupts off?
I know that should be possible as it is an elementary thing in programming microcontrollers.
Thanks for help
Gamepad --> PC --> PyBoard
Re: Gamepad --> PC --> PyBoard
Hello, I do not exactly know what you are looking form, but in class usb_vcp, usb_vcp.setinterrupt(-1) would disable Ctrl-C as interrupt character on the USB interface.
To revert that, call setinterrupt with a value of 3 (= Ctrl-C)
Regards
Code: Select all
import pyb
usb_vcp = pyb.USB_VCP()
usb_vcp.setinterrupt(-1)
Regards
Re: Gamepad --> PC --> PyBoard
Yes, exatly that.
Thank you, that helped a lot
Thank you, that helped a lot
Re: Gamepad --> PC --> PyBoard
Hello! How about this?
-
- Posts: 5
- Joined: Mon Nov 07, 2016 2:50 am
Re: Gamepad --> PC --> PyBoard
How do I connect a generic SNES USB PC gamepad directly into pyboard?
I have the current setup:
USB gamepad -> usb female breakout -> pyboard -> PC via UART (to read values via screen /dev/ttyACM0)
USB Breakout wiring between the pad and pyboard:
USB red wire to V3.3
USB ground wire to to GND
D+ to X10
D- to X9
Is there a way to read the gamepad events via UART and just print the byte codes on the screen? Or is it not supposed to be connected that way?
I was able to read and detect USB on PC: Arch / Raspbian and read button presses using various Python 3 libraries like "input",
but without any OS on the pyboard is it possible to get external peripherals (mouse/gamepad/keyboard) working with MicroPython?
I have the current setup:
USB gamepad -> usb female breakout -> pyboard -> PC via UART (to read values via screen /dev/ttyACM0)
USB Breakout wiring between the pad and pyboard:
USB red wire to V3.3
USB ground wire to to GND
D+ to X10
D- to X9
Is there a way to read the gamepad events via UART and just print the byte codes on the screen? Or is it not supposed to be connected that way?
I was able to read and detect USB on PC: Arch / Raspbian and read button presses using various Python 3 libraries like "input",
but without any OS on the pyboard is it possible to get external peripherals (mouse/gamepad/keyboard) working with MicroPython?