Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Elite Dangerous (and others) Button Box with state change

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6

    Elite Dangerous (and others) Button Box with state change

    I have found many button boxes, that cover almost 90% of what I want to do. It was most of those projects that directed me to teensy.

    The one thing I have not been able to find a direct answer on is dealing with state changes in the game.

    A prime example is the landing gear. This is a momentary switch, making it so I can't use a toggle (physical) switch, but a button. So what I want to do is turn an LED on when deployed, and off when not.

    Using an application like EDDI I can get ship status updates and forward those to other applications.

    Is this possible?

    Would it be easier to use one teensy to be the actual buttons/toggles/asxis and another one to control the lights?

    Thank you,
    Z

  2. #2
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6
    Guess I will just have to try it and see what happens.

  3. #3
    Your lack of replies is probably due to the broadness of your questions. It's hard to tell how complex your setup will be. For example, 5 buttons and 5 LEDs? Teensy can handle that no problem. 20 buttons and 20 LEDs then you'll need to look at more ways of managing your inputs and outputs.

    As for getting application data? I have no experience with your applications but if you're able to pull game states from the game then you should be able to write a program (python?, Wiring?) that takes that data and passes it to the Teensy via the usb connection (Serial Data). Again, this is dependant on the work you want to do and what is currently available.

    You will certainly learn more from trying and more effective feedback to very specific questions. i.e. how do I read the state of a button? how do I light an LED when the button changes? etc, and the tutorials for teensy can handle many of these issues.

  4. #4
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6
    To start, 4 axis. Throttle, rudder, stick.
    30 buttons
    30 leds

    Teensy 3.5 or 3.6, currently have one of each.

    Been reading up on keyboard and led matrixes, hence asking about them.

    EDDI is the application that gets game state, and I can have it expose the data in many ways.

    Thank you for a response. I apologize for being so vague.

  5. #5
    I would say starting with 5 LEDs and 5 buttons to interface with EDDI would probably be a good starting point. Even just getting 5 buttons to change 5 leds on the teensy locally would be a very beginners start if this is all new to you. I would keep in mind that complexity is actually just layers and layers. Once buttons works, then you add leds, then you add throttle then you add stick etc etc. The end goal is highly complex but the building blocks are relatively simple. If there's anything specific I'd be happy to throw my hat in if I can help.

  6. #6
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6
    I have been walking through the arduino tutorials to reteach myself. It has been a couple decades since I worked at this level. Even as a ham radio op, I have been lax in my basic electronics.

    As I got the LEDs and Buttons (basics) done, this weekend I am going to try and get a matrix wired up. Just got all of the LEDs in. The one issue with no longer being in the Seattle area, and instead being in rural Oklahoma. Can't just run to vetco for parts.

    I think my first real stumbling point will be getting status updates from the computer.

    Is it possible to be a joystick and serial device?

  7. #7
    My understanding (very limited) is that a joystick will appear as a "HID" device. I believe it's possible to have both HID + Serial with the teensy but there should be other guides available in the forum.

  8. #8
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6
    So, one of the states that I want to get from the game, I can't. It isn't exposed in any of the logs, and the API is not available to developers.

    This means I need to not send a button press to the system when doing a reset of the state on teensy.

    Example:

    Toggle and LED for Landing Gear is out of sync with the game.

    Flip a "Ignore" toggle to "on", and now I can sync any of the LEDs and Toggles, in this case landing gear, to match the game and the computer doesn't get the signal.
    Flip the "Ignore" toggle to "off" and next time I flip the landing gear toggle, it sends the button press to the computer.

    Not sure I am explaining it clearly enough.

    Another way to explain.

    Game shows landing gear is deployed.
    Physical panel shows it is not.

    Engage ignore, then cycle the landing gear on the physical panel until it matches in game, with the computer/game non-the-wiser.

    Disengage ignore, and next time it is cycled, it also cycles it in the game.

    I have been trying to google/forum search for the answer to no avail.

    My brain says "This is a stupid simple thing to do." .. yet as I am still learning arduino/teensy coding I admit I am a bit lost.

    I have no code/wiring at the moment for this. Still working on the feasibility design.

  9. #9
    What you want to achieve is absolutely doable and I understand where you're coming from in order to sync your game and teensy state.

    As a "non programmer" it may help you to consider drawing some flow charts (draw.io is a good site). I find when I'm sketching an idea out that putting down a flow chart allows me to better consider the logic of what I'm trying to achieve.

    I'm on mobile at the moment but would be happy to sketch out a simplified example for you tomorrow.

  10. #10
    Junior Member
    Join Date
    Mar 2019
    Location
    Oklahoma
    Posts
    6
    Funny enough, I am a programmer. I design and run enterprise IT monitoring systems.

    The coding I do though is mostly scripting or .net based as of late. Some python now and then.

    I am working on diagrams for layout, and yes, flowcharts are a must.

    Thank you.

  11. #11
    Awesome in that case here's what I would do as an example.

    Create a class "eddi message send" that handles everything required to send the messages to your game api. Then in your loop do a check "is sync button enabled" (high or low). If it is then set a toggle in your message class that does "ignore sending messages". Then all of your other code will run as normal but none of your eddi messages will send out until the button is untoggled.

    Again when not on mobile I'd be happy to give a clearer answer.

  12. #12
    So this would be a very simplified flow diagram of how you could allow for syncing your teensy state with your game state.Click image for larger version. 

Name:	Untitled Diagram (2).png 
Views:	5 
Size:	40.4 KB 
ID:	16334
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled Diagram (1).png 
Views:	5 
Size:	28.2 KB 
ID:	16333  

Posting Permissions

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