Jump to content

Recommended Posts

Posted

Hey guys, at the suggestion of @sharkfin61 to possibly help others, and its about time I pay it back for all the help I've gotten on here, I'm posting my Arduino Sketch for the A10 Intercom Panel. I can't take full ownership of this concept and idea though, that would have to go to The Warthog Project, as it is his. Unfortunately he didn't post his sketch anywhere that I could find, so I had to ask around for some help and created this one for the concept. A special thanks and shout outs to @Vinc_Vega and @No1sonuk for all of their time and help with creating this sketch. 

In the actual A10 aircraft, and thus in DCS, you unmute the individual channels by using push pull volume selector knobs. Those aren't exactly easily found for the common consumer and sim builder. The Warthog Project came up with the brilliant idea of using Rotary Encoders with switches, and LEDs for the Channel Back Lighting, so that when you push the encoder switch to unmute the channel, the LED illuminates, indicating the channel is "active" or unmuted. Push it again and the channel is muted and the LED light extinguishes. Brilliant. This way its easy to see which channels are unmuted and or muted.

Here is the Arduino sketch to make all of that happen. This is also meant to be used in conjunction with DCS-BIOS:

/*
  Tell DCS-BIOS to use a serial connection and use interrupt-driven
  communication. The main program will be interrupted to prioritize
  processing incoming data.
 
  This should work on any Arduino that has an ATMega328 controller
  (Uno, Pro Mini, many others).
 */
#define DCSBIOS_IRQ_SERIAL
 
#include "DcsBios.h"
 
DcsBios::Switch2Pos intCall("INT_CALL", PIN);
 
const byte intModePins[4] = {PIN_1, PIN_2, PIN_3, PIN_4};
DcsBios::SwitchMultiPos intMode("INT_MODE", intModePins, 4);
 
DcsBios::Potentiometer intVol("INT_VOL", PIN);
 
// ----- INT Un-Mute input and output, INT volume adjustment -----
DcsBios::ActionButton intIntUnmuteToggle("INT_INT_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder;
FourStepRotaryEncoder intIntVol ("INT_INT_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intIntUnmute(0x1194, 0x8000, PIN); //  a LED shows if the volume adjustment is active
 
DcsBios::ActionButton intAimUnmuteToggle("INT_AIM_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intAimVol ("INT_AIM_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intAimUnmute(0x11a6, 0x0004, PIN);
 
DcsBios::ActionButton intFmUnmuteToggle("INT_FM_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intFmVol ("INT_FM_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intFmUnmute(0x119c, 0x8000, PIN);
 
DcsBios::ActionButton intIffUnmuteToggle("INT_IFF_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intIffVol ("INT_IFF_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intIffUnmute(0x11a6, 0x0008, PIN);
 
DcsBios::ActionButton intIlsUnmuteToggle("INT_ILS_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intIlsVol ("INT_ILS_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intIlsUnmute(0x11a6, 0x0010, PIN);
 
DcsBios::ActionButton intTcnUnmuteToggle("INT_TCN_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intTcnVol ("INT_TCN_VOL", "-1500", "+1500"PIN_A, PIN_B );
DcsBios::LED intTcnUnmute(0x11a6, 0x0020, PIN);
 
DcsBios::ActionButton intUhfUnmuteToggle("INT_UHF_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intUhfVol ("INT_UHF_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intUhfUnmute(0x11a6, 0x0002, PIN);
 
DcsBios::ActionButton intVhfUnmuteToggle("INT_VHF_UNMUTE", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
FourStepRotaryEncoder intVhfVol ("INT_VHF_VOL", "-1500", "+1500", PIN_A, PIN_B);
DcsBios::LED intVhfUnmute(0x11a6, 0x0001, PIN);
 
DcsBios::ActionButton intHmToggle("INT_HM", "TOGGLE", PIN); // INT switch on pin 10 for the INT Un-Mute switch
DcsBios::LED intHmUnmute(0x11a6, 0x0040, PIN);
 
void setup() {
  DcsBios::setup();
}
 
void loop() {
  DcsBios::loop();
}



 

 

  • Like 2
  • Thanks 1

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Posted (edited)

Thank you @Kenpilot for publishing your work and also a huge "thank you" to every helping hand out there.

I hope a lot of other simmers will chime in and help the upcoming (and existing) cockpit builders in their efforts.

I know, some will see it different, and in fact it surely is important to stick your nose inside the deep hollow of programming and writing code. But on the other hand, it might help people, who are about to give up their dream to built a working cockpit or desk-pit, to find back their way into the seat, flying once again and enjoy the work they have done and therefore, keep the cockpit building community alive. (a lot of words and wishes for 04:50 a.m.).

Edited by sharkfin61
  • Like 2

Loads do it on the fly!    Loads.jpg     Royal Bavarian Airforce all the way

RIG: RYZEN 7  5800X3D~ ZOTAC 4080 Super ~ AORUS X570S Elite AX ~64 GB Corsair Venegance DDR-4 3600 ~ BeQuiet AIO Silent loop 2 360  watercooled ~ Samsung 890 Pro M.2 (2TB) + 870 EVO (1TB) SSD ~ WIN 10 64-bit ~ AOC 31.5" Gaming 144Hz Display ~ DelanClip@TrackIR 5 ~ TM Warthog no.2 ~Saitek rudder pedals~ 2 TM MFDs on 2nd 27"display ~ Buddyfox A-10 UFC ~ CDU/AAP panel via DCSBios ~ ARC-210 (soldering WIP) ~
QUEST 3 

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...