Announcement

Collapse
No announcement yet.

Optishot Remote for < $20

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Optishot Remote for < $20

    Build a wooden box with some buttons, a joystick and a Arduino board.

    I've gotten a lot of help from here so figured i'd share back. Not sure if this was the place to post but I'm planning to make a pocket remote for controller my simulator. First step was to make a box with buttons and try it. Waiting for my office to be build and starting toying around. Just need to change the buttons for any system.


    Wood box which is 30cm by 30cm. The button holes are 29mm and the joystick was 35mm. All of these parts cant be bought on many websites. Just search arcade parts. The other item was a Leonardo Arduino compatibile board because it has a UART chip / HID that can do USB to the PC.
    So, in summary
    7 HAPP style buttoms
    1 Joystick - I cut the head off and mount a golf ball on it for effect
    1 - Ground cable that connects all of the switches (on the joystick too)
    11 - Single headed cables to connect to the Leoardo
    1 - Leonardo . Prices as low as $10 - https://www.arduino.cc/en/Main/ArduinoBoardLeonardo

    So all in money output was about $17. Time to make the box was 2 hours because i'm not proficient in that. Coding time for the board was about 30 minutes.

    Figured I'd share with everyone else here.

    Attached is pictures
    Here is the video - https://youtu.be/v7F9R-KMOTQ
    Attached is the Arduino code - as zip file, rename to INO as Arduino code- Also below just in case



    Code:
    #include <Keyboard.h>
    // char ctrlKey = KEY_LEFT_CTRL;
    char ctrlKey = KEY_LEFT_GUI;
    bool pressed = false;
    
    void setup() {
    // V0 T.S - Intial Sketch Idea
    // V0.1 T.S.  -- Pulled in Decimal Values from here http://www.asciitable.com/
    // V0.2 - Change the pinmode and buttonState to arrays after troubleshooting.
    // V0.3 - Wiring Test
    // V0.4 - Button Programming - Reference for Control+Key - https://www.arduino.cc/en/Reference/KeyboardPress
    // V0.5 - Fixed some repeat characters due to timing - delay of 250 is the lowest without guaranteed repeats
    
    Keyboard.begin();
    
    //Joystick and button connections
    pinMode(1, INPUT_PULLUP); //Button 1
    pinMode(2, INPUT_PULLUP); //Button 2
    pinMode(3, INPUT_PULLUP); //Button 3
    pinMode(4, INPUT_PULLUP); //Button 4
    pinMode(5, INPUT_PULLUP); //Button 5
    pinMode(6, INPUT_PULLUP); //Button 6
    pinMode(7, INPUT_PULLUP); //Button 7
    pinMode(8, INPUT_PULLUP); //Button 8
    pinMode(9, INPUT_PULLUP); //Button 9
    pinMode(10, INPUT_PULLUP); //Button 10
    pinMode(11, INPUT_PULLUP); //Button 11
    pinMode(12, INPUT_PULLUP); //Button 12
    pinMode(13, INPUT_PULLUP); //Button 13
    
    }
     
    void loop() {
     
    // Check the switches:
    int buttonState1 = digitalRead(1);
    int buttonState2 = digitalRead(2);
    int buttonState3 = digitalRead(3);
    int buttonState4 = digitalRead(4);
    int buttonState5 = digitalRead(5);
    int buttonState6 = digitalRead(6);
    int buttonState7 = digitalRead(7);
    int buttonState8 = digitalRead(8);
    int buttonState9 = digitalRead(9);
    int buttonState10 = digitalRead(10);
    int buttonState11 = digitalRead(11);
    int buttonState12 = digitalRead(12);
    int buttonState13 = digitalRead(13);
    
    //
    // we'll only act on a button press if button is low and pressed is false
    //
    
     
    // Button 1, Bottom Right Dark Blue Stripe = Pressed
    if (!pressed && buttonState1 == LOW) {
    pressed = true;
    Keyboard.press(128);
    delay(100);
    Keyboard.press(217);
      delay(100);
      Keyboard.releaseAll();
      delay(250);
    }
    else{
      pressed = false;
    Keyboard.releaseAll();
    }
     
    // Button 2, Bottom Right Grey Stripe = Pressed
    if (!pressed && buttonState2 == LOW) {
    pressed = true;
    Keyboard.press(128);
    delay(100);
    Keyboard.press(218);
      delay(100);
      Keyboard.releaseAll();
    }
    else{
      pressed = false;
    Keyboard.releaseAll();
    }
    
    // Button 3  White = Pressed
    if (!pressed && buttonState3 == LOW) {
      pressed = true;
    Keyboard.press(77);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(77);
    }
    
    // Button 4 Light Brown Stripe = Pressed
    if (!pressed && buttonState4 == LOW) {
        pressed = true;
    Keyboard.press(202);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(202);
    }
    
    // Button 5 Black Stripe = Pressed
    if (!pressed && buttonState5 == LOW) {
        pressed = true;
    Keyboard.press(177);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(177);
    }
    
    // Button 6 - Bottom Left - Magenta = Pressed
    if (!pressed && buttonState6 == LOW) {
        pressed = true;
    Keyboard.press(70);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(70);
    }
    
    // Button 7 - Bottom Left - Red  = Pressed
    if (!pressed && buttonState7 == LOW) {
        pressed = true;
    Keyboard.press(82);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(82);
    }
    
    // Button 8 - White Joystick Left = Pressed
    if (!pressed && buttonState8 == LOW) {
        pressed = true;
    Keyboard.press(216);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(216);
    }
    
    // Button 9 - Joystick Right = Pressed
    if (!pressed && buttonState9 == LOW) {
        pressed = true;
    Keyboard.press(215);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(215);
    }
    
    // Button 10 - Joystick Up = Pressed
    if (!pressed && buttonState10 == LOW) {
        pressed = true;
    Keyboard.press(218);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(218);
    }
    
    
    // Button 11 - Joystick Down = Pressed
    if (!pressed && buttonState11 == LOW) {
        pressed = true;
    Keyboard.press(217);
    delay(250);
    }
    else{
        pressed = false;
    Keyboard.release(217);
    }
    
    // End of Sketch here
    }

  • #16
    Glad you got it going chevynut. I'm pretty sure running as admin before you start the program using it (emulator, optishot, etc) is required.

    Comment


    • #17
      Finally got around to doing this. Got the arcade kit for Xmas and used what I had lying around to build the box for it. Used Joytokey to map the buttons. The software was extremely easy to work with. I was surprised. It's my understanding that after 30 days I will need to purchase a license for Joytokey. Not a big deal though. It's only $7. I still need to label the buttons but it works great. I am using it for TGC. Here's the kit I used:

      Comment


      • wbond
        wbond commented
        Editing a comment
        Are you able to completely get away from the keyboard for TGC now?

      • Jb50
        Jb50 commented
        Editing a comment
        As of now no. If I want to use the mini-map I still need to use the mouse. There are some other keystrokes that aren't programmed that I don't use often. Off the top of my head I programmed the following:

        joystick = L/R/U/D arrows to aim and work menu's
        x = club down
        y = club up
        enter = enter
        esc = menu
        q = scout
        E = Hole overview
        J = hole flyover
        I = shot analysis

        I would have to add more buttons to add functions. I could also make the joystick act like the mouse but I'm pretty satisfied how it's setup now. I haven't tried anything on the green with it yet and the reason I need the club up/down is because I am using Rmotion and you need to select club.

    • #18
      That's great jb50! Glad I was able to help.

      Hope it helps with your game experience too!

      Comment


      • Jb50
        Jb50 commented
        Editing a comment
        It was kind of fun to do. Got me thinking about maybe building an arcade box for some retro gaming.

    • #19
      Appreciate all the info in this thread, trying to build one of these on my own for Skytrak and TGC. I assume the set up would be the same, just different coding? I'm trying to piece together different threads on this forum to build one, but haven't been able to figure out everything 100% yet. Though this thread is killer and the most informative.

      Comment


      • #20
        I just finished building one of these for TGC2019 and it was super easy and cost effective.

        1. Purchased an ABS plastic box from Amazon ($19.99 CAD) - https://www.amazon.ca/gp/product/B083BVX19J
        2. Purchased an arcade button kit from Amazon ($32.99 CAD) - https://www.amazon.ca/gp/product/B01MR6JKMS
        3. Had a decal made to cover the top of the box with button labels ($12 CAD)
        4. Used JoytoKey software to program all buttons, which is super simple https://joytokey.net/en/

        Comment


        • #21
          Originally posted by JayJo13 View Post
          I just finished building one of these for TGC2019 and it was super easy and cost effective.

          1. Purchased an ABS plastic box from Amazon ($19.99 CAD) - https://www.amazon.ca/gp/product/B083BVX19J
          2. Purchased an arcade button kit from Amazon ($32.99 CAD) - https://www.amazon.ca/gp/product/B01MR6JKMS
          3. Had a decal made to cover the top of the box with button labels ($12 CAD)
          4. Used JoytoKey software to program all buttons, which is super simple https://joytokey.net/en/
          Do you have a pic of the finished box? Where did you get the decal made? Anything you would have done differently?

          Comment


          • JayJo13
            JayJo13 commented
            Editing a comment
            Sorry, I don't have a picture and I'm not close to my sim right now but I will post a picture later. No, I wouldn't have done anything differently. The decal I designed in Photoshop and had a local sign company (Speedpro Signs) print the decal. On the decal I had designed an "X" where I had to drill all the pilot holes. I used a 1-1/8" hole saw to drill the holes for the arcade buttons. Overall it was all pretty simple

        • #22
          Is anyone selling the unit ready to go I would be willing to pay for the work walking over to the computer to change clubs and everything is getting old? Thanks in advance

          Comment


          • #23
            You may be able to find someone on Fiverr that will build it for you or hire a student . The parts can be ordered on ebay or aliexpress. Let me know if you ahve questions

            Comment

            Working...
            X