If you were willing to do violence to your shield (and void the warranty! :shock: )
, you could clip off the shield pins that mate with Digital 11 (MOSI), 12 (MISO), and 13 (SCK), and solder three jumper wires in their place. Then, connect the wires to MOSI (pin 1), MISO (pin 4) and SCK (pin 3) on the ICSP header.
If you use something like our male<->female header jumper wires
, you wouldn't need to solder to the ICSP pins.
If you're lucky, you might be able to bend the pins on the shield instead of clipping them. Then you could use female<->female jumper wires
between the shield pins and the ICSP pins
bergowitch wrote:In this example it seems, that the joystick can only recognicze one direction and not diagonal (up and right at the same time)? is that right?
Wellll..... yes and no. If you look at the schematic below, you'll see that the joypad works by selecting different resistors to form a resistive voltage divider. The numbers that the example code is comparing with to determine which direction is selected are actually the voltages produced by this circuit. So, then you select UP, you connect to ground through the 10K resistor, which results in voltage reading of about 0.3V. Selecting LEFT connects through the 22Ohm resistor, and you get a voltage reading of around 3.23V*
So, you can compute the voltage readings for diagonal selections and, theoretically, detect those as well. And it almost works. Up is 0.3V, Right is 1.65V, and Right/Up is 1.73V. But the other combinations start to crowd too closely together to expect reliable results. For example Left, Left/Down, and Left/Up are virtually identical, at around 3.23V.
You'll also notice that pressing a direction and SELECT simultaneously will produce a different reading than they will individually.
*calculated values. the shieldtest example code appears to use empirically-derived numbers, as they are a bit lower.