DCS-BIOS Discussion Thread - Page 79 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 09-06-2017, 05:32 PM   #781
[FSF]Ian
ED Testers Team
 
Join Date: Feb 2013
Location: Dortmund, Germany
Posts: 1,210
Reputation power: 12
[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice
Default

@Chapman: please open a separate thread for further troubleshooting (this thread has gotten confusing in the past when several conversations were going on at once). Try the interactive control reference (see youtube video) and if that works, try using TCP instead of UDP (edit connect-serial-port.cmd and use "set PROTOCOL=TCP").
[FSF]Ian is offline   Reply With Quote
Old 09-09-2017, 10:57 AM   #782
ruprecht
Member
 
Join Date: Jul 2008
Location: Brisbane
Posts: 460
Reputation power: 10
ruprecht will become famous soon enoughruprecht will become famous soon enough
Default

Hey, I'm giving this a try as my BetaInnovations products no longer have software support.

I couldn't find a callback for the eject handle in the A10C, does it not exist? How would I implement a physical eject handle with dcs-bios? Thanks

*edit* for clarity, I have the hardware built to trip a microswitch when yanked, I'm just chasing the appropriate arduino code. Thanks
__________________
DCS Wishlist: | Navy F-14 | Navy F/A-18 | AH-6 | Navy A-6 | Tiger ARH | Carrier Ops | Dynamic Campaign |
ruprecht is offline   Reply With Quote
Old 09-09-2017, 05:34 PM   #783
[FSF]Ian
ED Testers Team
 
Join Date: Feb 2013
Location: Dortmund, Germany
Posts: 1,210
Reputation power: 12
[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice
Default

When I added the A-10C to DCS-BIOS, I added everything from the clickabledata.lua file. Since the eject handle is not clickable in the cockpit, it's not in DCS-BIOS.
[FSF]Ian is offline   Reply With Quote
Old 09-09-2017, 11:28 PM   #784
ruprecht
Member
 
Join Date: Jul 2008
Location: Brisbane
Posts: 460
Reputation power: 10
ruprecht will become famous soon enoughruprecht will become famous soon enough
Default

I suspected as much, thanks. So given your arduino experience is way more advanced than mine, how would you do it? All I can think of is a) sending a keystroke from the arduino (rather than Lua callback) or b) somehow configuring the duino as a HID?
__________________
DCS Wishlist: | Navy F-14 | Navy F/A-18 | AH-6 | Navy A-6 | Tiger ARH | Carrier Ops | Dynamic Campaign |
ruprecht is offline   Reply With Quote
Old 09-10-2017, 06:20 PM   #785
[FSF]Ian
ED Testers Team
 
Join Date: Feb 2013
Location: Dortmund, Germany
Posts: 1,210
Reputation power: 12
[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice
Default

You are on the right track.

You can use an Arduino with ATMega32u4 controller (Pro Micro, Leonardo) to send Ctrl+E or a joystick button three times. Pro Micro clones from China are about $3.60.
[FSF]Ian is offline   Reply With Quote
Old 09-11-2017, 08:34 AM   #786
ruprecht
Member
 
Join Date: Jul 2008
Location: Brisbane
Posts: 460
Reputation power: 10
ruprecht will become famous soon enoughruprecht will become famous soon enough
Default

Excellent, I've only done some basic stuff with Uno's but I'll get onto it and post results. Cheers
__________________
DCS Wishlist: | Navy F-14 | Navy F/A-18 | AH-6 | Navy A-6 | Tiger ARH | Carrier Ops | Dynamic Campaign |
ruprecht is offline   Reply With Quote
Old 09-16-2017, 02:46 PM   #787
Ganeshka
Junior Member
 
Join Date: Oct 2015
Location: Ukraine
Posts: 66
Reputation power: 0
Ganeshka can only hope to improve
Default

Hello , can i use Arduino pro micro + KEY MATRIX + DCS Bios ?
Ganeshka is offline   Reply With Quote
Old 09-19-2017, 12:51 PM   #788
ruprecht
Member
 
Join Date: Jul 2008
Location: Brisbane
Posts: 460
Reputation power: 10
ruprecht will become famous soon enoughruprecht will become famous soon enough
Default

OK so my Pro Micro arrived and I've designed this for my eject handle. Seems to work OK on my dev box but we'll see once it's hooked up to DCS. Thanks again for the guidance [FSF]Ian

Code:
// Eject switch for DCS World
// Requires ATmega32U4 based Arduino (Pro Micro, Leonardo etc)
// Connect eject switch from D2 to 5V
// Connect 10k resistor from D2 to GND
// Connect USB to sim host PC

const char ctrlKey = KEY_LEFT_CTRL; // Windows/Linux
// const char ctrlKey = KEY_LEFT_GUI; // MacOS
const char ejectKey = 'e';
const int buttonPin = 2;
bool debounce = false;
int buttonState = 0;

void setup() {
  Keyboard.begin();
  pinMode(buttonPin, INPUT);
}

void loop() {
  // has eject been pressed?
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {
    if (!debounce) {
      debounce = true;
      eject();
    }
  } else {
    debounce = false;
  }
}

void eject() {
  // give it 5 presses in case of something lost in the ether
  for (int i = 0; i < 5; i++) {
    Keyboard.press(ctrlKey);
    delay(50);
    Keyboard.write(ejectKey);
    delay(50);
    Keyboard.release(ctrlKey);
    delay(100);
  }
}
__________________
DCS Wishlist: | Navy F-14 | Navy F/A-18 | AH-6 | Navy A-6 | Tiger ARH | Carrier Ops | Dynamic Campaign |
ruprecht is offline   Reply With Quote
Old 09-19-2017, 01:16 PM   #789
[FSF]Ian
ED Testers Team
 
Join Date: Feb 2013
Location: Dortmund, Germany
Posts: 1,210
Reputation power: 12
[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice[FSF]Ian is just really nice
Default

Quote:
Originally Posted by Ganeshka View Post
Hello , can i use Arduino pro micro + KEY MATRIX + DCS Bios ?
Yes and no.

No, there is no support for a key matrix in the DCS-BIOS Arduino Library. That means you can't expect to copy and paste a code snippet and have things work out of the box.

Yes, you can use DCS-BIOS with anything you can connect to an Arduino board, if you know or are willing to learn C++.

For example, to push down the master caution reset button in the A-10C, you can use the following code in your Arduino sketch:
Code:
sendDcsBiosMessage("UFC_MASTER_CAUTION 1\n");
And to release it again:
Code:
sendDcsBiosMessage("UFC_MASTER_CAUTION 0\n");
For more information, consult the "import protocol" section of the Developer Guide and the "input interfaces" section of the user guide. You can also read through the source code of the DCS-BIOS Arduino Library, for example Switches.h. (Those classes use a different function, tryToSendDcsBiosMessage, that won't block if it cannot send the message right away; if it returns false, it means the message has not actually been sent.)


@Everyone: please excuse the long response times. I am dealing with a tinnitus right now that is preventing me from getting a good night's sleep on a regular basis.
[FSF]Ian is offline   Reply With Quote
Old 09-19-2017, 03:40 PM   #790
ruprecht
Member
 
Join Date: Jul 2008
Location: Brisbane
Posts: 460
Reputation power: 10
ruprecht will become famous soon enoughruprecht will become famous soon enough
Default

I couldn't wait It works perfectly! Bed time.
__________________
DCS Wishlist: | Navy F-14 | Navy F/A-18 | AH-6 | Navy A-6 | Tiger ARH | Carrier Ops | Dynamic Campaign |
ruprecht is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:17 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.