Jump to content

Sting57

Members
  • Posts

    233
  • Joined

  • Last visited

Everything posted by Sting57

  1. Hi, I am using some of the above code to output my f18 radar altimeter min height to an oled. As the guage on the hornet scales (ie not a 1 to1) I need to map the values. I need some help with the maping, 0 to 34407 should show 0 to 400 34408 to 52559 should show 401 to 1000 above 52560 should show 1001 to 5000 This is my attempt at the mapping code if (newValue < 34407) { minHeight = map(newValue, 0, 34407, 0 , 400); } if (newValue > 34408 && < 52259) { minHeight = map(newValue, 34408, 52259, 401 , 1000); } else minHeight = map(newValue, 52260, 65539, 1001, 5000); but it no work.... Obviously I am not a coder and are just trying to reverse engineer all the examples I see. So the above is just an attempt that works if I remove the second "i"f and adjust the mapping values. Any help would be appreciated. This the full code for reference #define DCSBIOS_IRQ_SERIAL #include <DcsBios.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 32 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); unsigned int minHeight = 0; //Set Height void setup() { display.begin(SSD1306_SWITCHCAPVCC, 0x3C); display.clearDisplay(); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onRadaltMinHeightPtrChange(unsigned int newValue) { if (newValue < 34407) { minHeight = map(newValue, 0, 34407, 0 , 400); } if (newValue > 34408 && < 52259) { minHeight = map(newValue, 34408, 52259, 401 , 1000); } else minHeight = map(newValue, 52260,65539, 1001, 5000); display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(20,0); display.print(minHeight); display.display(); } DcsBios::IntegerBuffer radaltMinHeightPtrBuffer(0x7518, 0xffff, 0, onRadaltMinHeightPtrChange);
  2. Thank you for updating the main branch.
  3. your amazing!!! What an awesome member!!! Thankyou so much.
  4. Ok thank you for replying. I have updated the lua as you suggested. My code in sketch is simply #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" DcsBios::LED consoleIntLt(0x74d4, 0x2000, 6); /* paste code snippets from the reference documentation here */ void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } using pin 6 as it is a pwm pin. now the light does not even come on, so i am obviously missing some steps here (sorry n00b) Not sure what you mean here: . So read this afterwards and map to your output: void onConsolesDimmerChange(unsigned int newValue) { /* your code here */ } DcsBios::IntegerBuffer consolesDimmerBuffer(0x7544, 0xffff, 0, onConsolesDimmerChange); or here? Map to your PWM range and you're good to go.
  5. Is this possible for the Fa18 as well??
  6. Amazing. Order inbound.
  7. So I am just starting to build my pit, should I be using the Flightpanel fork? Is the orginal fork dead? I know I had to update the orginal one to fix the ECM panel for the hornet.
  8. Ok just incase someone else finds this. The Hornet plugin for DCS Bios is out of date with DCS. To fix this issue: I edited this file (the hornet plugin for dcs bios) C:\Users\XXXXXXX\AppData\Roaming\DCS-BIOS\Plugins\module-fa-18c-hornet\FA18-C_hornet.lua I changed this line defineTumb("ECM_MODE_SW", 0, 3116, 248, 0.1, {0.0, 0.4}, nil, false, "Dispenser/EMC Panel", "ECM Mode Switch, XMIT/REC/BIT/STBY/OFF") to this defineTumb("ECM_MODE_SW", 66, 3001, 248, 0.1, {0.0, 0.4}, nil, false, "Dispenser/EMC Panel", "ECM Mode Switch, XMIT/REC/BIT/STBY/OFF") And that is it. This is the post that helped. So Thank you BlackLibrary!!!
  9. it is the only piece of code in the sketch. I wonder than if that internal "lookup table" has not been updated to the new switch?
  10. Hi just trying to setup the ASPJ swtich on the hornet ECM panel. I have my rotary switch all wired up I am using the following code from DCS BIOS const byte ecmModeSwPins[5] = {3, 8, 9, 11, 13}; DcsBios::SwitchMultiPos ecmModeSw("ECM_MODE_SW", ecmModeSwPins, 5); However the switch does not work. ( I have checked the controls and have no other buttons mapped to the ecm mode switch. I have tested the switch on other functions (RADAR, DDI switch etc) and it works fine, so I know my wiring is all good. Any idea's on why I am having issues with the above code? Has DCS changed the naming of the function, if so how would i check? Thanks Sting
  11. Thanks mate, your image is much clearer then mine.
  12. Yep it is exactly that, what my question is,. What is the number? I can't read the text. I think it says 35.80 inches. Sent from my Lenovo TB-X605F using Tapatalk
  13. Hi All currently in the very early process of building my VR hornet pit. The best dimensions image I could find is this one. Anyone know what the number circled in Red is?
  14. Hi Mate, just saw the cock you built,  amazing working.  I planning on doing nearly the exact same thing.  Do you have plans/dimension that you used or is it all just best guess work?  Specifically interested in the front panel design.  Even if you had more photos of the construction.

     

     

    cheers

     

     

    Mike

  15. Nice idea! thanks
  16. Hi all,probably a silly question, however I am flying the Oil in the Water campaign (higly recommended), however the Missions gives you ag targets in bullzeye location. What is the best way to slew your AG sensors to a bullzeye location in the hornet? Up until now i have only seen bullzeye used for AA targets.
  17. Up to Mission 6, Great fun campaign. Watching the carrier group defend itself was pure joy. So glad sea mode was added to the Hornet before i started this campaign. Thanks Again, immersion wise, as good as any paid campaign i have played.
  18. Atari, you finally came to my Hornet!!!
  19. With thanks to Cluster - https://www.digitalcombatsimulator.com/en/files/3301053/?sphrase_id=907625
  20. Excellent!! and thank you!
  21. Thank you.
  22. Hi all sorry for what is probably a stupid question, however in the mission editor I used to be able to select Australia for Country and then the F/A18C Lot 20 would be an option in Type. Now it is no longer available as an option. The F/A 18C Lot 20 is only available when I select country USA. Is this a recenty change or am I missing? I have old missions where I was able to add an Aussie Hornet.
  23. Thank you Redkite, excellent video!!
  24. Why did he arm the laser?
×
×
  • Create New...