Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTD/R MAG SWITCH working (DDI Export) #855

Closed
1 task done
Ben-F111 opened this issue Jul 20, 2024 · 2 comments · Fixed by #856
Closed
1 task done

LTD/R MAG SWITCH working (DDI Export) #855

Ben-F111 opened this issue Jul 20, 2024 · 2 comments · Fixed by #856
Assignees

Comments

@Ben-F111
Copy link

Version

  • I am using the latest version

Aircraft

FA-18

Control

LDT/R (MAG HOLD)

Description

All other Mag SW in the FA-18 can be mimicked by Mapping and combining "States" and Variables to closely match the real, however the LDT/R has no additional Variable to Hold the MAG Closed when the Laser is "ARMED",

if the TEXT from the DDI "L ARM" can be exported and used in BIOS or ARDUINO, this will create a variable that can be used to HOLD the LDT/R in the on position if using a MAG SW

addStrokeText("MPD_FLIR_LaserStatus_label", "", STROKE_FNT_DFLT_120, "CenterCenter", {0, 400}, laserArmedRoot.name, {{"MPD_FLIR_LaserStatus_Label"}},
{"", "L ARM", "M ARM", "LTD/R", "MARK", "LTD", "LTD/R", "MARK"})

extract a "state" or "Text Value" from the F18 "FLIR_AG.lua" to use in Arduino - "MPD_FLIR_LaserStatus_Label"

DCS World\Mods\aircraft\FA-18C\Cockpit\Scripts\Multipurpose_Display_Group\Common\indicator\Pages\MPD\FLIR

Screenshots

image

Additional context

With thanks Ben

@Ben-F111 Ben-F111 added enhancement needs triage The issue has yet to be reviewed by a maintainer labels Jul 20, 2024
@charliefoxtwo charliefoxtwo removed the needs triage The issue has yet to be reviewed by a maintainer label Jul 20, 2024
@charliefoxtwo
Copy link
Member

As discussed on discord, but documenting here for posterity - we don't normally export DDI/MPD contents (it would just be too much), but this seems like a reasonable exception to help pit builders set up magnetically-held switches

@Ben-F111
Copy link
Author

Ben-F111 commented Jul 20, 2024

Test Arduino Code


#define DCSBIOS_DEFAULT_SERIAL
#include "DcsBios.h"

String LaserSTATUS_HUD;


DcsBios::Switch2Pos ltdRSw("LTD_R_SW", 12);
 
void onHudLtdrChange(char* newValue) {

  LaserSTATUS_HUD = newValue;
  if (LaserSTATUS_HUD == "L ARM"){                   // is "L ARM" being displayed on the HUD
 digitalWrite(LED_BUILTIN, HIGH);                        // turn output High (MS ON)//MAG SW OUTPUT, SET TO PIN As needed 
                                                                                Currently BUILT IN LED
  } 
else{
    digitalWrite(LED_BUILTIN, LOW);                         //MAG SW OUTPUT, SET TO PIN As needed Currently BUILT IN LED
}
  
  }DcsBios::StringBuffer<5> hudLtdrBuffer(0x75a2, onHudLtdrChange);

void setup() {
  DcsBios::setup();
  pinMode(LED_BUILTIN, OUTPUT);                           //MAG SW OUTPUT, SET TO PIN As needed Currently BUILT IN LED
}

void loop() {
  DcsBios::loop();

}

`

charliefoxtwo added a commit to charliefoxtwo/dcs-bios that referenced this issue Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants