Hi,
i've build a working vusb with hid mouse example from vusb download package. Now i modified them a bit to become gamepad. After googling a bit and read a bit from some places, i got the buttons working, and later adc working. but there is a bit problem with the adc return value. it's a bit jumpy, not jumpy like go up and down, but jumpy like not smooth transition. so every little potentiometer change it doesn't showed up in properties, until some turn it changed but it jumped a bit far. later i tried to exclude the adc process, and using normal incremental local variable as report value. It turned out it has same jumpy symptom. now i am confused. where is the problem actually?
this is my main.c code : http://pastebin.com/tPEUm7G9
this is my usbconfig.h code: http://pastebin.com/aBDf0zZn
my hardware is same like with-series-diode picture on vusb download package,except the xtal is 12mhz.
any help appreciated. Thanks in advance.
vusb joystick analog problem
Re: vusb joystick analog problem
The problem should be due to timing or math. You didn't post the a2dRead function, or I failed to find it. If you see a pattern like this
**
****
**
instead of a circle, the pots x,y may be sharing ground or like. When one pot reaches full right it may be pulling the other back.
**
****
**
instead of a circle, the pots x,y may be sharing ground or like. When one pot reaches full right it may be pulling the other back.
Re: vusb joystick analog problem
i don't use the adc function yet. just simulate the return value with dummy incremental variable. you can see i commented them in main.c
update: i managed to get another usb example mjoyv1.1 working, and modify one of analog input with incremental variable (the dial). strangely, the symptom is same. i can't understand, why it can't move smoothly?
update: i managed to get another usb example mjoyv1.1 working, and modify one of analog input with incremental variable (the dial). strangely, the symptom is same. i can't understand, why it can't move smoothly?
-
- Posts: 6
- Joined: Sun Mar 20, 2016 4:30 am
Re: vusb joystick analog problem
Could it be a problem with the host PC?
I was testing a joystick I'd built on a friend's laptop recently, and the Joystick control panel was very ... jumpy(?) -- it would occasionally lock up and stop getting updates on some button presses or the Joystick axis... -- Sometimes the crosshairs would disappear from the Joystick axis too, and certain buttons just would just kind of crap out, or get stuck... it was the weirdest thing ever....
I didn't actually try to play games on that computer, but I think it may have been that he was using Windows 7 -- and the joystick control panel just wasn't very responsive on his PC?
I didn't have any of those troubles on my home PC, and in playing MAME, etc. on my Raspberry PI it all seemed to work really well with no issues.
I was testing a joystick I'd built on a friend's laptop recently, and the Joystick control panel was very ... jumpy(?) -- it would occasionally lock up and stop getting updates on some button presses or the Joystick axis... -- Sometimes the crosshairs would disappear from the Joystick axis too, and certain buttons just would just kind of crap out, or get stuck... it was the weirdest thing ever....
I didn't actually try to play games on that computer, but I think it may have been that he was using Windows 7 -- and the joystick control panel just wasn't very responsive on his PC?
I didn't have any of those troubles on my home PC, and in playing MAME, etc. on my Raspberry PI it all seemed to work really well with no issues.