![]() |
|
#14
|
||||
|
||||
|
So after some help from C6_trollbug I now have the wires setup correctly... unfortunately they are reversed i.e. rather than turning on when i press a button they turn off
Here is the code I am using... void setup() { pinMode(0, INPUT_PULLUP); pinMode(1, INPUT_PULLUP); pinMode(2, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); } void loop() { // read the digital inputs and set the buttons Joystick.button(1, digitalRead(0)); Joystick.button(2, digitalRead(1)); Joystick.button(3, digitalRead(2)); Joystick.button(4, digitalRead(3)); // a brief delay, so this runs 20 times per second delay(50); }
__________________
![]() Gigabyte X58A-UD5 | Intel i7 930 | Corsair H70 | ATI 5970 | 6GB Kingston DDR3 | Intel 160GB G2 | Win 7 Ultimate 64 Bit |
MONITOR: Acer S243HL. CASE: Thermaltake LEVEL 10. INPUTS: KG13 Warthog, Saitek Pedals, Track IR 4. |
| Thread Tools | |
| Display Modes | |
|
|