As this is only your second time working with electronics, I'll try to keep my terminology simple.
It's hard to see exactly how you have wired up the sensor and LED, but I can take a guess. (If I'm wrong, then everything below probably makes no sense).
The sensor is connected between + power and the Arduino input, while the LED is connected between - power and the Arduino input.
When you press the sensor, electrical current can flow from the + side of the power the Arduino sensor pin, charging it up and giving it a high voltage. Current also flows through the LED, causing it to light up.
Now, what happens When you release the sensor? The electrical charge inside the Arduino sensor pin which was giving it a high voltage, will now flow as current through the LED to - power, bringing the voltage down, so that the Arduino sees you've let go.
But what happens if you don't have an LED in there? The electrical charge in the Arduino sensor pin has nowhere to go, and so it just stays there, and the voltage doesn't change.
The reason the Arduino's sensor pin behaves like this is because it behaves like a tiny capacitor. It can store a small amount of electrical charge, and thus 'remember' the voltage that was placed on them by the sensor.
So, how can you fix it? You'll need to have somewhere for this charge to flow. If not an LED, then a resistor should do. Any value between 1k and 1000k will probably work fine.
You can't have pressure sensitive buttons. You need to specify them as additional axes.
Additionally, the controller really has 12 pressure sensitive buttons? In that case, you're out of luck, as I have yet to find any software that works with more then 8 axes (including windows!).
Furthermore, you can consolidate some of your axes controlls:
const PROGMEM USB_Descriptor_HIDReport_Datatype_t hidDescriptor[] =
{
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x05, // USAGE (Game Pad)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Pointer)
0xa1, 0x00, // COLLECTION (Physical)
// ----- Consolidated
// ; Right stick
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
// ; Left stick
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (4) //changed
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
0x05, 0x09, // USAGE_PAGE (Button)
// this section isn't going to work...
// ; Pressure sensitive buttons
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x0c, // USAGE_MAXIMUM (Button 12)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x0c, // REPORT_COUNT (12)
0x81, 0x02, // INPUT (Data,Var,Abs)
// this section will, though the previous section will likely break something, and the whole descriptor will likely be rejected.
// ; Other buttons (L3, R3, Select, Start)
0x19, 0x0d, // USAGE_MINIMUM (Button 13)
0x29, 0x10, // USAGE_MAXIMUM (Button 16)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0 // END_COLLECTION
};
What I suspect is happening is the computer is interpreting a 0
for the value on the buttons as "not pressed", and anything else as "pressed". As such, unless the button completely returns to the unpressed state, the button will seem to "stick".
Anyways, the generic desktop
usage page of the HID usage table actually only defines a total of 9 analog axes in it's entirety, so you're kind of out of luck. Even the windows controller diagnostic only supports a maximum of 8 axes, and most libraries that access gamepads support even fewer.
DirectX, for example, only allows you to access 6 analog axes.
Anyways, take a look at the USB HID usage tables here.
I also spent a while playing with HID tables in the process of converting an arduino leonardo into a joystick. Look at that here.
Incidentally, if you can, I recommend a Arduino Leonardo for this sort of tinkering. It's a lot easier to deal with then trying to re-flash the ATmega8U2 in a Arduino Uno.
Best Answer
In this answer I showed that the optimal series resistor value is
\$ R_S = \sqrt{R_{MIN} \cdot R_{MAX}} \$
where \$R_{MIN}\$ and \$R_{MAX}\$ are the minimum and maximum resistances of your sensor. The Sparkfun page speaks of between infinity and 300 kΩ. If we assume 10 MΩ as maximum value then your series resistor should be 1.8 MΩ (rounded to nearest E12 value).
These are pretty high values, too high for an ADC, which, like Mathieu says, likes a impedance of less than 10 kΩ. So you'll need to buffer the divider with an unity gain buffer opamp:
Note that a common opamp may have an input bias current as high as 1 µA, and this could distort your reading. A CMOS opamp like the MCP600x has a much lower input bias current, 1 pA typical for the MCP600x, which won't deteriorate your reading.