mindlord said:
That's just it. The nub isn't really supposed to. Any analog input device works by mesuring a potential across a the range of the sensor. When the user isn't inputting anything it should register 0 on the X axis, and 0 on the Y axis. Push the stick left and you get a negative number registering on the stick the farther you push the farther the number gets from 0. Push right, and the number goes up, higher numbers the farther you push. The normal behavior for a joystick is to send absolutely nothing when the joystick is centered, even if there's a thumb on it. Not even the fact that it's at 0. But the Pandora nub firmware for some reason sends streams of zeros when the thumb is resting on the stick. The tiny vibrations from a person's thumb aren't significant enough to put the sensor completely to -1 or +1, but still enough to cause the firmware to send a 0. Again most joysticks won't even bother sending the zero that's created by the tiny vibrations of a thumb resting on them, but the Pandora nub does.
Most joysticks are analog devices that constantly send out two voltages between 0 and X, where 0 means far left/down, and X means far right/up (or the opposite). This voltage then needs to go through some kind of ADC to convert it into something the CPU can use. The ADC must always output something: if it is 0, it spits out 0. If it is X, it spits out 255 (for an 8 bit ADC. They may use 4, 10, or 16 bit instead, but I digress). The CPU then polls this signal, and uses it to determine the orientation of the joystick. If it is right in the middle, it is a stream of 128,128 which the CPU interprets as centered. It takes these numbers, does some subtraction, and comes up with a scale from -Y to +Y which the program in question uses.
The nub on the Pandora is slightly different. It still has the analog and ADC, but instead of sending that signal directly to the CPU, it has one more layer. It goes through some microcontroller that reads the digital signal and does the thinking for the CPU. Instead of the CPU checking what the ADC is constantly, it asks the microcontroller for an update. The conversation kinda goes like this
Code:
// not touching the nub at all, so it is perfectly centered
CPU: Status report
NUB: no change
CPU: Status report
NUB: no change
// person touches the nub, but doesn't move it. Thumb vibrates ever so slightly, causing slight shift in the ADC, but not enough for the nub to think it's useful
CPU: Status report
NUB: position 0,0 and has moved 0,0 since last time you asked
// then person moves to the right
CPU: Status report
NUB: position 10,0 and has moved 10,0 since last time you asked
// then person moves it to the top
CPU: Status report
NUB: position 0,10 and has moved -10,10 since last time you asked
// person then lets go of the nub
CPU: Status report
NUB: position 0,0 and has moved 0,-10 since last time you asked
CPU: Status report
NUB: no change
...
So to summarize, an ADC cannot output "nothing", there is always a signal. In tradition joysticks, the CPU polls the ADC and knows exactly where it is from that. In contrast, our nub with its semi-intelligent microcontroller can send a "nothing" signal. "Nothing" means it doesn't detect any movement at all from the ADC, it is sitting at what the CPU would interpret as dead centre. It sees "0, 0, 0, 0, 0..." and doesn't bother to send it if the CPU asks. If a person puts their thumb on the nub, however, their thumb causes it to twitch ever so slightly: -1, 0, -1, 1, 0, 1, -1... The microcontrol says "that's basically 0, I should tell the CPU about it". And that's how a string of 0s indicates that someone is touching the nub but not moving it, while a "nothing" signal indicates it is not being touched at all.