Results 1 to 7 of 7

Thread: Button Box Wiring Help

  1. #1
    Superkart Pilot ecstaticbrick's Avatar
    Join Date
    May 2015
    Location
    London
    Posts
    310
    Platform
    PC

    Button Box Wiring Help

    Edit: Please ignore this or can a mod delete this post. The answer is NO it won't work and is almost completely wrong :-(

    I have removed the images so that no one copies it and get it so badly wrong like I did. Sorry.


    Hi all, I need a bit of help.

    I got bored and thought I would try my hand at building a pro micro button box but, I have never had any experience with wiring matrix' before. I know there are tutorial videos out there but they skip parts that seem obvious but, they really aren't.

    I have planned out what I think is correct but, could someone with experience look over my pictures and let me know if it will work or do I need to make changes.

    Any help would be appreciated.
    Last edited by ecstaticbrick; 17-05-2020 at 00:18.
    i7 7700k | MSI Z270 Gaming M7 | RAM 32GB @ 3000mhz | MSI GTX 1080ti | Fanatec CSW V2.5 | Fanatec CSP V3 | Oculus Rift

  2. #2
    Superkart Pilot Maskmagog's Avatar
    Join Date
    Sep 2017
    Location
    Sweden
    Posts
    739
    Platform
    XBOX1 X
    Have a look in my thread (http://forum.projectcarsgame.com/sho...x-input-wanted). I used a buttonmatrix, total 5 rotary encoders, and maybe 16 buttons. There´s both pictures and the code I used.

    Don't remember much of the details now, but feel free to ask any questions you have. There are no stupid questions
    Thrustmaster TX, Ferrari 599XX Alcantara rim, T3PA-Pro, Firmware 54, Xbox One X, public OS, 28" 4K monitor
    Don't miss Yorkie065's excellent videos: Ep26-LiveTrack pt1. Ep 27-LiveTrack pt2.
    Project CALC - cross-platform PC2 leaderboards per car - Xbox/PS4/PC - Forum thread
    The following user likes this Post: ecstaticbrick


  3. #3
    Superkart Pilot ecstaticbrick's Avatar
    Join Date
    May 2015
    Location
    London
    Posts
    310
    Platform
    PC
    Thanks for the link. I actually had some one explain it to me by voice and it made more sense. I don't no why but, I had it in my mind that I could wire positives in parallel and the negatives in parallel but still being in groups but, the arduino code wouldn't have worked for that and I don't know enough about writing a custom code... Yet :-)

    Just got to practice soldering and I will post again if I get it to work.
    i7 7700k | MSI Z270 Gaming M7 | RAM 32GB @ 3000mhz | MSI GTX 1080ti | Fanatec CSW V2.5 | Fanatec CSP V3 | Oculus Rift
    The following user likes this Post: Maskmagog


  4. #4
    WMD Member Shepard2603's Avatar
    Join Date
    Sep 2012
    Location
    Bedburg
    Posts
    333
    Platform
    PC
    @ecstaticbrick Arduino isn't that difficult to code. I build a button box for flight sim with it. It's some typing effort, but the logic behind it, is pretty straight forward.

    Code:
    #include <Keyboard.h>#define MasterArmTrain 0     //LCtrl+LAlt+'m'
    #define MasterArmOFF 0       //LCtrl+LShift+'m'
    #define MasterArmON 1        //LShift+LAlt+'m'
    #define TGPOFF 2             //LCtrl+LShift+'t'
    #define TGPON 2              //LCtrl+LShift+'t'
    #define LaserTrain 3         //LCtrl+LShift+'l'
    #define LaserOFF 3           //LCtrl+LAlt+'l'
    #define LaserON 4            //LAlt+LShift+'l'
    #define AP 5                 //'a'
    #define AP_PATH 6            //'2'
    #define AP_ALT_BANK 7        //'4'
    #define AP_ALT_HDG 8         //'3'
    #define GearDown 9           //LShift+'g'
    #define GearUp 9             //LCtrl+'g'
    #define FlapsDown_1 10       //'f'
    #define FlapsDown_2 11       //'f'
    #define FlapsUp_1 11         //LShift+'f'
    #define FlapsUp_2 10         //LShift+'f'
    #define CanopyOpen A0        //'c'
    #define CanopyClose A1       //'c'
    
    
    int switchStateMasterArm = 0;
    int switchStateTGP = 0;
    int switchStateLaser = 0;
    int switchStateGear = 0;
    int switchStateFlaps = 0;
    // int switchStateCanopy = 0;
    
    
    void setup() {
      // put your setup code here, to run once:
        delay(5000);
        pinMode(0, INPUT_PULLUP);
        pinMode(1, INPUT_PULLUP);
        pinMode(2, INPUT_PULLUP);
        pinMode(3, INPUT_PULLUP);
        pinMode(4, INPUT_PULLUP);
        pinMode(5, INPUT_PULLUP);
        pinMode(6, INPUT_PULLUP);
        pinMode(7, INPUT_PULLUP);
        pinMode(8, INPUT_PULLUP);
        pinMode(9, INPUT_PULLUP);
        pinMode(10, INPUT_PULLUP);
        pinMode(11, INPUT_PULLUP);
        pinMode(12, INPUT_PULLUP);
        pinMode(A0, INPUT_PULLUP);
        pinMode(A1, INPUT_PULLUP);
      
     }
    
    
    void loop() {
      // put your main code here, to run repeatedly:
     
       //MasterArmTrain
      if ((digitalRead(MasterArmTrain) == LOW) && (switchStateMasterArm != 1)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(130); //LAlt
        Keyboard.press('m');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateMasterArm = 1;
      }
      //MasterArmOFF
      if ((digitalRead(MasterArmOFF) == HIGH) && (switchStateMasterArm != 0)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(129); //LShift
        Keyboard.press('m');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateMasterArm = 0;
      }
      //MasterArmON
      if ((digitalRead(MasterArmON) == LOW) && (switchStateMasterArm != 2)) {
        Keyboard.begin();
        Keyboard.press(129); //LShift
        Keyboard.press(130); //LAlt
        Keyboard.press('m');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateMasterArm = 2;
      }
      //TGPOFF
      if ((digitalRead(TGPOFF) == HIGH) && (switchStateTGP != 0)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(129); //LShift
        Keyboard.press('t');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateTGP = 0;
      }
      //TGPON
      if ((digitalRead(TGPON) == LOW) && (switchStateTGP != 2)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(129); //LShift
        Keyboard.press('t');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateTGP = 2;
      }
      //LaserTrain
      if ((digitalRead(LaserTrain) == LOW) && (switchStateLaser != 1)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(129); //LShift
        Keyboard.press('l');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateLaser = 1;
      }
      //LaserOFF
      if ((digitalRead(LaserOFF) == HIGH) && (switchStateLaser != 0)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press(130); //LAlt
        Keyboard.press('l');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateLaser = 0;
      }
      //LaserON
      if ((digitalRead(LaserON) == LOW) && (switchStateLaser !=2)) {
        Keyboard.begin();
        Keyboard.press(129); //LShift
        Keyboard.press(130); //LAlt
        Keyboard.press('l');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateLaser = 2;
      }
      //AP ON/OFF
      if (digitalRead(AP) == LOW) {
        Keyboard.begin();
        Keyboard.write('a');
        delay(100);
        Keyboard.end();
      }
      //AP_PATH
      if (digitalRead(AP_PATH) == LOW) {
        Keyboard.begin();
        Keyboard.write('2');
        delay(100);
        Keyboard.end();
      }
      //AP_ALT_BANK
      if (digitalRead(AP_ALT_BANK) == LOW) {
        Keyboard.begin();
        Keyboard.write('4');
        delay(100);
        Keyboard.end();
      }
      //AP_ALT_HDG
      if (digitalRead(AP_ALT_HDG) == LOW) {
        Keyboard.begin();
        Keyboard.write('3');
        delay(100);
        Keyboard.end();
      }
      //GearDown
      if ((digitalRead(GearDown) == HIGH) && (switchStateGear != 0)) {
        Keyboard.begin();
        Keyboard.press(129); //LShift
        Keyboard.press('g');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateGear = 0;
      }
      //GearUp
      if ((digitalRead(GearUp) == LOW) && (switchStateGear != 1)) {
        Keyboard.begin();
        Keyboard.press(128); //LCtrl
        Keyboard.press('g');
        delay(100);
        Keyboard.releaseAll();
        Keyboard.end();
        switchStateGear = 1;
      }
      //Flaps
      if ((digitalRead(10) == HIGH) && (digitalRead(11) == HIGH) && (switchStateFlaps == 0)){
          Keyboard.begin();
          Keyboard.releaseAll();
          Keyboard.end();}
        else{
            //FlapsDown_1
            if ((digitalRead(FlapsDown_1) == HIGH) && (digitalRead(FlapsDown_2) == HIGH) && (switchStateFlaps != 1)) {
            Keyboard.begin();
            Keyboard.write('f');
            delay(100);
            Keyboard.releaseAll();
            Keyboard.end();
            switchStateFlaps = 1;
            }
          //FlapsDown_2
          if ((digitalRead(FlapsDown_1) == HIGH) && (digitalRead(FlapsDown_2) == LOW) && (switchStateFlaps != 2)) {
            Keyboard.begin();
            Keyboard.write('f');
            delay(100);
            Keyboard.releaseAll();
            Keyboard.end();
            switchStateFlaps = 2;
            }
          //FlapsUp_1
          if ((digitalRead(FlapsUp_1) == HIGH) && (digitalRead(FlapsUp_2) == HIGH) && (switchStateFlaps != 3)) {
            Keyboard.begin();
            Keyboard.press(129); //LShift
            Keyboard.press('f');
            delay(100);
            Keyboard.releaseAll();
            Keyboard.end();
            switchStateFlaps = 3;
            }
           //FlapsUp_2
          if ((digitalRead(FlapsUp_2) == LOW) && (digitalRead(FlapsUp_1 == HIGH)) && (switchStateFlaps != 4)) {
            Keyboard.begin();
            Keyboard.press(129); //LShift
            Keyboard.press('f');
            delay(100);
            Keyboard.releaseAll();
            Keyboard.end();
            switchStateFlaps = 4;
            }
        }
      //CanopyClose
      if (digitalRead(CanopyClose) == LOW) {
          Keyboard.begin();
          Keyboard.write('c');
          delay(100);
          Keyboard.releaseAll();
          Keyboard.end();
      }
      //CanopyOpen
      if (digitalRead(CanopyOpen) == LOW) {
          Keyboard.begin();
          Keyboard.write('c');
          delay(100);
          Keyboard.releaseAll();
          Keyboard.end();
      }
    }
    Ryzen 5 2600x | Arctic Freezer 33 Plus | Gigabyte X470 AORUS Ultra Gaming | GIGABYTE GeForce GTX 1060 G1 Gaming 6G | 16GB G.SKILL RIPJAWS V 3200 | Fanatec CSL Elite Wheel Base + CSL Elite McLaren GT3 + Fanatec Clubsport V3 Pedals | Thrustmaster TH8A Shifter - Windows 10 x64


    Member of Revolution Sim Racing
    The following user likes this Post: ecstaticbrick


  5. #5
    Superkart Pilot ecstaticbrick's Avatar
    Join Date
    May 2015
    Location
    London
    Posts
    310
    Platform
    PC
    Shepard2603, that might as well be Esperanto to me lol

    Maskmagog, did you use solder? I'm struggling with it :-(
    i7 7700k | MSI Z270 Gaming M7 | RAM 32GB @ 3000mhz | MSI GTX 1080ti | Fanatec CSW V2.5 | Fanatec CSP V3 | Oculus Rift

  6. #6
    Superkart Pilot Maskmagog's Avatar
    Join Date
    Sep 2017
    Location
    Sweden
    Posts
    739
    Platform
    XBOX1 X
    Yes, solder. I'm an old sound engineer so I'm used to soldering. Get as decent equipment as you can. Watch some youtube videos, plenty of tutorials. Have patience, and practice
    Thrustmaster TX, Ferrari 599XX Alcantara rim, T3PA-Pro, Firmware 54, Xbox One X, public OS, 28" 4K monitor
    Don't miss Yorkie065's excellent videos: Ep26-LiveTrack pt1. Ep 27-LiveTrack pt2.
    Project CALC - cross-platform PC2 leaderboards per car - Xbox/PS4/PC - Forum thread
    The following user likes this Post: ecstaticbrick


  7. #7
    Rookie
    Join Date
    Feb 2021
    Posts
    1
    Platform
    PC
    I had the same problem exactly a year later, probably it occurs more often in winter, judging by the practice. I asked my father to help me because he is well versed in this field, but he was in another city and could not come. He gave me the contacts of service to find the best electricians in my city and they helped me to solve this problem, as they said it was in the violation of the current supply and most likely the reason for this was water although I do not remember that I drowned it, hehe. However, after that, the problem disappeared and did not occur again

Similar Threads

  1. DIY PCB USB Button Box for PS4/PC for under $20 USD
    By rotorrian in forum PS4 - Technical Help & Support
    Replies: 385
    Last Post: 02-09-2018, 22:27
  2. trying to map DSD button box to PS4
    By jaybaai1 in forum Technical Help & Support (PS4)
    Replies: 2
    Last Post: 22-02-2018, 18:56
  3. DIY handbrake wiring - G29 PS4
    By 8lb6ozBabyJesus in forum Project CARS on Playstation 4
    Replies: 2
    Last Post: 15-07-2016, 15:33
  4. Button Box
    By BreadedVirus in forum Project CARS on Playstation 4
    Replies: 3
    Last Post: 14-06-2016, 04:12
  5. Known Bug? Button #1
    By Pfalzdriver in forum PC - Technical Help & Support
    Replies: 4
    Last Post: 11-05-2016, 12:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •