Jump to content

HMA's cockpit build


Hansolo

Recommended Posts

Hans, your ability to find this stuff is absolutely incredible! Really jealous. Anyway, glad you found a solution to that. I'm a bit surprised that the switch is weak enough to keep the cover down, though I do know the real aircraft covers like that are pretty stiff. (Especially if they have the hole in the end and the little tab where you place the break-away wire.)

Buttons aren't toys! :smilewink:

 

My new Version 2 Pit: MacFevre A-10C SimPit V2

My first pit thread: A-10C Simulator Pit "The TARDIS."

Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener

Link to comment
Share on other sites

  • 3 weeks later...

TACAN working full range

 

Thanks guys :)

 

Been working a little extra on getting the TACAN to work for all channels. I had tried to do converting from characters to integer but failed. The other day I got an idea of trying to map each of the characters from DCS to an integer in a similar way as I did with the rotary switches;

 

int DCS_Tacan_right()
{
 int DCS_valueTacan_right;
 if (Tacan_ingame1 == '0') {
   DCS_valueTacan_right = 0;
 }
 if (Tacan_ingame1 == '1') {
   DCS_valueTacan_right = 1;
 }
 if (Tacan_ingame1 == '2') {
   DCS_valueTacan_right = 2;
 }
 if (Tacan_ingame1 == '3') {
   DCS_valueTacan_right = 3;
 }
 if (Tacan_ingame1 == '4') {
   DCS_valueTacan_right = 4;
 }
 if (Tacan_ingame1 == '5') {
   DCS_valueTacan_right = 5;
 }
 if (Tacan_ingame1 == '6') {
   DCS_valueTacan_right = 6;
 }
 if (Tacan_ingame1 == '7') {
   DCS_valueTacan_right = 7;
 }
 if (Tacan_ingame1 == '8') {
   DCS_valueTacan_right = 8;
 }
 if (Tacan_ingame1 == '9') {
   DCS_valueTacan_right = 9;
 }
 return DCS_valueTacan_right;
}

 

In each IF statements the Arduino check if the character received from DCS is equal value e.g. '0' then assigned the interter to the value 0 (zero). It actually works :lol:

 

This is what it looks like when running.

 

 

Sorry for a slight desync when I overlayed the second video. As you can see it still ones in a while overshoots but returns to the actual value.

 

This is the complete code;

/*
 The following #define tells DCS-BIOS that this is a RS-485 slave device.
 It also sets the address of this slave device. The slave address should be
 between 1 and 126 and must be unique among all devices on the same bus.
*/
#define DCSBIOS_RS485_SLAVE 23

/*
 The Arduino pin that is connected to the
 /RE and DE pins on the RS-485 transceiver.
*/
#define TXENABLE_PIN 2

#include "DcsBios.h"
#include <timer.h>

Timer tm;
int Tacan_ingame1; // hold value from DCS for ones
int Tacan_ingame10; // hold value from DCS for tens
int Tacan_ingame100; // hold value from DCS for hundreds

/* paste code snippets from the reference documentation here */
//TACAN test button
DcsBios::Switch2Pos tacanTestBtn("TACAN_TEST_BTN", 3);

//TACAN test light
DcsBios::LED tacanTest(0x10da, 0x0400, 13);

//TACAN Channel X/Y Toggle
const byte tacanXyPins[2] = {4, 5};
DcsBios::SwitchMultiPos tacanXy("TACAN_XY", tacanXyPins, 2);

//TACAN Mode Dial
const byte tacanModePins[5] = {6, 7, 8, 9, 10};
DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5);

//TACAN Signal Volume
DcsBios::Potentiometer tacanVol("TACAN_VOL", A0);

//TACAN Channel
void onTacanChannelChange(char* newValue) {
 Tacan_ingame1 = newValue[2];       //TACAN Right Channel
 Tacan_ingame10 = newValue[1];        //TACAN Left Channel
 Tacan_ingame100 =newValue[0];       //Tacan left channel hundrets
}
DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);




void setup() {
 DcsBios::setup();

 //TACAN_1 inputs
 DDRA = B00000000; // set PINA (digital 29-22) as inputs
 PORTA = B11111111; // Sets (digital 29-22) with internal pull up

 //TACAN_10 inputs
 DDRC = B00000000; // set PINA (digital 30-37) as inputs
 PORTC = B11111111; // Sets (digital 30-37) with internal pull up
 tm.startTimer(200, setTacan);

}

int inputTacan_right()
{
 int valueTacan_right;
 if (PINA == B11110010) {
   valueTacan_right = 0;
 }
 if (PINA == B11110101) {
   valueTacan_right = 1;
 }
 if (PINA == B11101011) {
   valueTacan_right = 2;
 }
 if (PINA == B11101111) {
   valueTacan_right = 3;
 }
 if (PINA == B11101110) {
   valueTacan_right = 4;
 }
 if (PINA == B11011101) {
   valueTacan_right = 5;
 }
 if (PINA == B11011011) {
   valueTacan_right = 6;
 }
 if (PINA == B11011111) {
   valueTacan_right = 7;
 }
 if (PINA == B10111110) {
   valueTacan_right = 8;
 }
 if (PINA == B00111101) {
   valueTacan_right = 9;
 }
 return valueTacan_right;
}

int inputTacan_left()
{
 int valueTacan_left;
 if (PINC == B11110010) {
   valueTacan_left = 0;
 }
 if (PINC == B11110101) {
   valueTacan_left = 1;
 }
 if (PINC == B11101011) {
   valueTacan_left = 2;
 }
 if (PINC == B11101111) {
   valueTacan_left = 3;
 }
 if (PINC == B11101110) {
   valueTacan_left = 4;
 }
 if (PINC == B11011101) {
   valueTacan_left = 5;
 }
 if (PINC == B11011011) {
   valueTacan_left = 6;
 }
 if (PINC == B11011111) {
   valueTacan_left = 7;
 }
 if (PINC == B10111110) {
   valueTacan_left = 8;
 }
 if (PINC == B00111101) {
   valueTacan_left = 9;
 }
 if (PINC == B00111011) {
   valueTacan_left = 10;
 }
 if (PINC == B01111111) {
   valueTacan_left = 11;
 }
 if (PINC == B11111110) {
   valueTacan_left = 12;
 }
 return valueTacan_left;
}

int DCS_Tacan_right()
{
 int DCS_valueTacan_right;
 if (Tacan_ingame1 == '0') {
   DCS_valueTacan_right = 0;
 }
 if (Tacan_ingame1 == '1') {
   DCS_valueTacan_right = 1;
 }
 if (Tacan_ingame1 == '2') {
   DCS_valueTacan_right = 2;
 }
 if (Tacan_ingame1 == '3') {
   DCS_valueTacan_right = 3;
 }
 if (Tacan_ingame1 == '4') {
   DCS_valueTacan_right = 4;
 }
 if (Tacan_ingame1 == '5') {
   DCS_valueTacan_right = 5;
 }
 if (Tacan_ingame1 == '6') {
   DCS_valueTacan_right = 6;
 }
 if (Tacan_ingame1 == '7') {
   DCS_valueTacan_right = 7;
 }
 if (Tacan_ingame1 == '8') {
   DCS_valueTacan_right = 8;
 }
 if (Tacan_ingame1 == '9') {
   DCS_valueTacan_right = 9;
 }
 return DCS_valueTacan_right;
}

int DCS_Tacan_left()
{
 int DCS_valueTacan_left;
 if ( Tacan_ingame100 == '0'){
   
 if (Tacan_ingame10 == '0') {
   DCS_valueTacan_left = 0;
 }
 if (Tacan_ingame10 == '1') {
   DCS_valueTacan_left = 1;
 }
 if (Tacan_ingame10 == '2') {
   DCS_valueTacan_left = 2;
 }
 if (Tacan_ingame10 == '3') {
   DCS_valueTacan_left = 3;
 }
 if (Tacan_ingame10 == '4') {
   DCS_valueTacan_left = 4;
 }
 if (Tacan_ingame10 == '5') {
   DCS_valueTacan_left = 5;
 }
 if (Tacan_ingame10 == '6') {
   DCS_valueTacan_left = 6;
 }
 if (Tacan_ingame10 == '7') {
   DCS_valueTacan_left = 7;
 }
 if (Tacan_ingame10 == '8') {
   DCS_valueTacan_left = 8;
 }
 if (Tacan_ingame10 == '9') {
   DCS_valueTacan_left = 9;
 }
 }

 else {
 if (Tacan_ingame10 == '0') {
   DCS_valueTacan_left = 10;
 }
 if (Tacan_ingame10 == '1') {
   DCS_valueTacan_left = 11;
 }
 if (Tacan_ingame10 == '2') {
   DCS_valueTacan_left = 12;
 } 
   
 }
 return DCS_valueTacan_left;
}

void loop() {
DcsBios::loop();
tm.runTimers();

}

void setTacan(int timer){
   if (DCS_Tacan_right() < inputTacan_right()) {
   sendDcsBiosMessage("TACAN_1", "INC");
 }

 if (DCS_Tacan_right() > inputTacan_right()) {
   sendDcsBiosMessage("TACAN_1", "DEC");
}

 if (DCS_Tacan_left() < inputTacan_left()) {
   sendDcsBiosMessage("TACAN_10", "INC");
 }

 if (DCS_Tacan_left() > inputTacan_left()) {
   sendDcsBiosMessage("TACAN_10", "DEC");
 }

}

 

I may see if I can assign a preliminary value to the three integers Tacan_ingame1, 10 & 100 so that it doesn't start to send as soon as I power up the Arduino.

 

Cheers

Hans

Link to comment
Share on other sites

Side console chopped

 

Had a day off so decided to chop my right side console up :music_whistling: It's been on my list for some time because the amount of panels I have made working lately won't fit. The beam along the side of the console won't allow for the ILS nor TACAN to be inserted. They are simply too deep with all the mechanical switches as well as the Arduino setup. Also the MDF sections fill up too much. It hasn't been much of a problem before simply because the depth wasn't that big.

 

Here is a few shot showing the beam removed and also the individual plates cut.

C4wwKeal.jpg

 

qsfRPAbl.jpg

 

Both consoles have done a pretty good job so far and I have had them since the beginning which is 6 years ago.

 

I found some old DZUS rails on Ebay a while back and decided to install those. I mounted a 25x2mm aluminum flat bar between the console side wall and the DZUS.

 

It's far from perfect but I got the side up and running again for tonight's flight and then I also have some idea of what kind of a beat I am up against when I eventually will try and make the side consoles in aluminum :cry:

 

As I have run out of room in the left console until that is being chopped up, the intercom panel will temporarily live in the right side;

 

eiaJnXMl.jpg

 

I'll have to find a screen for the CDU (C-130) which hopefully can run via DCS-BIOS instead of a viewport.

 

The HARS panels isn't correct for the A-10. It has a rotary switch instead of the toggle DG-SLAVE. It may be off an F-15 but apart from that it is in pretty good shape. I am still working on a setup for getting the needle gauge to work, got hold of a chip that can convert 5VDC into plus-minus 10VDC.

 

This was the initial trial so still some tweaking to do :-)

 

Cheers

Solo

Link to comment
Share on other sites

...

I found some old DZUS rails on Ebay a while back and decided to install those.

...

Jealous on that. I plan to drill it myself.... OMG!!! Will have to make some what like a Jig.

 

...

I'll have to find a screen for the CDU (C-130) which hopefully can run via DCS-BIOS instead of a viewport.

...

What about this?

https://photos.google.com/photo/AF1QipN9hWYUtQbHCV6DjUaov6VJ9j6R7vbpf-lOOwWS

 

I use it and it's almost perfect. (quiet slow a bit)

It is just to stack on an UNO.

Visible area is 73 by 48,5 mm (green rectangle, I drawed on the protective film), vertical distance (center to center) between LSBs is about 10mm. As I don't know the measures of the Real Thing... Ask, if you need some other dimensions. :)

Purchased it at China.

https://www.aliexpress.com/item/2017-New-Arrival-3-5-inch-TFT-Color-Screen-Module-320X480-Ultra-HD-for-UNO-and/32806100432.html

Have a medium sized Box filled with that (as I planned to build a batch of CDUs to commit it to the community - but I found much less time as intended :( )

See some pictures of the whole project here: https://photos.app.goo.gl/e5s8gbk8vlNBDIHR2 (The swagging is just for demonstration ;))

 

If you dont want to go the long way (4 to 6 weeks by Aliexpress): I could give you one of mine plus a ready programmed UNO. Delivery should be just a few days.

 

Edit: You do an amazing piece of work there. Hats off!!!


Edited by Tekkx

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

If you dont want to go the long way (4 to 6 weeks by Aliexpress): I could give you one of mine plus a ready programmed UNO. Delivery should be just a few days.

 

Edit: You do an amazing piece of work there. Hats off!!!

 

Thanks Tekkx. If you already have the LCD's in stock I might as well buy it of you instead of waiting. PM inbound Sir

 

Cheers

Link to comment
Share on other sites

Hans, I wanted to let you know that your TACAN fix was genius. I used it on my TACAN and it worked the very first try! I truly don’t know what I would do without you!

 

PS I had a different timer library than you and got that sorted out as well.

 

I’m working on my CDU today!

Link to comment
Share on other sites

  • 2 weeks later...

AN/ARC-186

 

Thansk pavespawn and glad you got it working :thumbup:

 

Whoohoo got the AN/ARC-186 up and running.

 

4hTlcw4l.jpg?1

 

Acquired a set 2 years a go where all the internals had been removed, so not exactly a working radio. Think seller had tried to see if he could convert it into a sim but had never finished.

 

The only PCB available in the ones I had was the one that hold the switches. Since it obviously wasn't prepared for DCS-BIOS but for a working unit there was a large numbers of diode on the PCB to give the radio controller board (missing) the inputs needed.

I gave up on trying to figure out head and tails on the diode setup so de-solderen them all. After removing them I found out that the PCB is at least three layers so no wonder I wasn't able to trace the line.

 

Had initially hope that the 40 pin on that back side was able to provide me with enough info but had to abandon that idea. After de-soldering the diodes I was able to measure enough point that would allow me to determine the position of the rotary. For frequencies MHz in tenths (0 – 9), and MHz in hundredths I only got 9 input so the code basically checks is it has one of the 9 input or else it's in the tenth position.

 

The Preset selector only used 5 pins for the 20 channels but it's not binary nor grey code. Fact is it doesn't matter because I just used the same mapping system I used on the TACAN. The comparison code base from the TACAN is also the same.

 

/*
 The following #define tells DCS-BIOS that this is a RS-485 slave device.
 It also sets the address of this slave device. The slave address should be
 between 1 and 126 and must be unique among all devices on the same bus.
*/
#define DCSBIOS_RS485_SLAVE 26

/*
 The Arduino pin that is connected to the
 /RE and DE pins on the RS-485 transceiver.
*/
#define TXENABLE_PIN 2

#include "DcsBios.h"
#include <timer.h>
Timer tm;

// set pin numbers:
const int Freq1_3 = 57;
const int Freq1_4 = 58;
const int Freq1_5 = 59;
const int Freq1_6 = 60;
const int Freq1_7 = 61;
const int Freq1_8 = 62;
const int Freq1_10 = 63;
const int Freq1_11 = 64;
const int Freq1_12 = 65;
const int Freq1_13 = 66;
const int Freq1_14 = 67;
const int Freq1_15 = 68;

const int Freq2_1 = 35;
const int Freq2_2 = 36;
const int Freq2_3 = 37;
const int Freq2_4 = 38;
const int Freq2_5 = 39;
const int Freq2_6 = 40;
const int Freq2_7 = 41;
const int Freq2_8 = 42;
const int Freq2_9 = 43;

const int Freq3_1 = 12;
const int Freq3_2 = 11;
const int Freq3_3 = 10;
const int Freq3_4 = 9;
const int Freq3_5 = 8;
const int Freq3_6 = 7;
const int Freq3_7 = 6;
const int Freq3_8 = 5;
const int Freq3_9 = 4;

const int Freq4_00 = 53;
const int Freq4_50 = 52;
const int Freq4_75 = 51;

const int Mode_1 = 56;
const int Mode_2 = 55;

//Variables
int Freq1_DCS = 9;  //Initial value set for 12
int Freq2_DCS = 0;  //Initial value set for 0
int Freq3_DCS = 0;  //Initial value set for 0
int Freq4_DCS = 0;  //Initial value set for .00
int Mode_DCS = 0;   //Initial value set for OFF
int Preset_DCS = 0; //Initial value set for 1

/* paste code snippets from the reference documentation here */
//Frequency selecto1 1  
void onVhfamFreq1Change(unsigned int newValue) {
  Freq1_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamFreq1Buffer(0x118e, 0x000f, 0, onVhfamFreq1Change);

//Frequency selector 2
void onVhfamFreq2Change(unsigned int newValue) {
  Freq2_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamFreq2Buffer(0x118e, 0x00f0, 4, onVhfamFreq2Change);

//Frequency selector 3
void onVhfamFreq3Change(unsigned int newValue) {
  Freq3_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamFreq3Buffer(0x118e, 0x0f00, 8, onVhfamFreq3Change);

//Frequency selector 4
void onVhfamFreq4Change(unsigned int newValue) {
  Freq4_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamFreq4Buffer(0x118e, 0x7000, 12, onVhfamFreq4Change);

//Frequency Selection Dial FM/AM/MAN/PRE
const byte vhfamFreqemerPins[4] = {50, 49, 48, 47};
DcsBios::SwitchMultiPos vhfamFreqemer("VHFAM_FREQEMER", vhfamFreqemerPins, 4);

//Mode dial
void onVhfamModeChange(unsigned int newValue) {
Mode_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamModeBuffer(0x1186, 0x0300, 8, onVhfamModeChange);

//Load Button
DcsBios::Switch2Pos vhfamLoad("VHFAM_LOAD", 46);

//Squelch
DcsBios::Switch3Pos vhfamSquelch("VHFAM_SQUELCH", 45, 44);

//VHF FM Volume Control
DcsBios::Potentiometer vhfamVol("VHFAM_VOL", A0);

//VHF FM Preset
void onVhfamPresetChange(unsigned int newValue) {
Preset_DCS = newValue;
}
DcsBios::IntegerBuffer vhfamPresetBuffer(0x117c, 0xf800, 11, onVhfamPresetChange);

//Master caution lamp - coms test
DcsBios::LED masterCaution(0x1012, 0x0800, 13);

void setup() {
 DcsBios::setup();
 //Preset inputs
 DDRA = B00000000; // set PINA (digital 29-22) as inputs
 PORTA = B11111111; // Sets (digital 29-22) with internal pull up


 //Inputs
 pinMode(Freq1_3, INPUT_PULLUP);
 pinMode(Freq1_4, INPUT_PULLUP);
 pinMode(Freq1_4, INPUT_PULLUP);
 pinMode(Freq1_6, INPUT_PULLUP);
 pinMode(Freq1_7, INPUT_PULLUP);
 pinMode(Freq1_8, INPUT_PULLUP);
 pinMode(Freq1_10, INPUT_PULLUP);
 pinMode(Freq1_11, INPUT_PULLUP);
 pinMode(Freq1_12, INPUT_PULLUP);
 pinMode(Freq1_13, INPUT_PULLUP);
 pinMode(Freq1_14, INPUT_PULLUP);
 pinMode(Freq1_15, INPUT_PULLUP);

 pinMode(Freq2_1, INPUT_PULLUP);
 pinMode(Freq2_2, INPUT_PULLUP);
 pinMode(Freq2_3, INPUT_PULLUP);
 pinMode(Freq2_4, INPUT_PULLUP);
 pinMode(Freq2_5, INPUT_PULLUP);
 pinMode(Freq2_6, INPUT_PULLUP);
 pinMode(Freq2_7, INPUT_PULLUP);
 pinMode(Freq2_8, INPUT_PULLUP);
 pinMode(Freq2_9, INPUT_PULLUP);

 pinMode(Freq3_1, INPUT_PULLUP);
 pinMode(Freq3_2, INPUT_PULLUP);
 pinMode(Freq3_3, INPUT_PULLUP);
 pinMode(Freq3_4, INPUT_PULLUP);
 pinMode(Freq3_5, INPUT_PULLUP);
 pinMode(Freq3_6, INPUT_PULLUP);
 pinMode(Freq3_7, INPUT_PULLUP);
 pinMode(Freq3_8, INPUT_PULLUP);
 pinMode(Freq3_9, INPUT_PULLUP);

 pinMode(Freq4_00, INPUT_PULLUP);
 pinMode(Freq4_50, INPUT_PULLUP);
 pinMode(Freq4_75, INPUT_PULLUP);

 pinMode(Mode_1, INPUT_PULLUP);
 pinMode(Mode_2, INPUT_PULLUP);

 tm.startTimer(200, setVHF);
}

int inputFreq1()
{
 int valueFreq1;
 if (digitalRead(Freq1_3) == LOW) {  ///OBS!
   valueFreq1 = 0;
 }
 else if (digitalRead(Freq1_4) == LOW) { //OBS!
   valueFreq1 = 1;
 }
 else if (digitalRead(Freq1_5) == LOW) {  //OBS!
   valueFreq1 = 2;
 }
 if (digitalRead(Freq1_6) == LOW) {
   valueFreq1 = 3;
 }
 if (digitalRead(Freq1_7) == LOW) {
   valueFreq1 = 4;
 }
 if (digitalRead(Freq1_8) == LOW) {
   valueFreq1 = 5;
 }
 if (digitalRead(Freq1_10) == LOW) {
   valueFreq1 = 7;
 }
 if (digitalRead(Freq1_11) == LOW) {
   valueFreq1 = 8;
 }
 if (digitalRead(Freq1_12) == LOW) {
   valueFreq1 = 9;
 }
 if (digitalRead(Freq1_13) == LOW) {
   valueFreq1 = 10;
 }
 if (digitalRead(Freq1_14) == LOW) {
   valueFreq1 = 11;
 }
 if (digitalRead(Freq1_15) == LOW) {
   valueFreq1 = 12;
 }
 return valueFreq1;
}


int inputFreq2()
{
 int valueFreq2;
 if (digitalRead(Freq2_1) == LOW) {
   valueFreq2 = 1;
 }
 else if (digitalRead(Freq2_2) == LOW) {
   valueFreq2 = 2;
 }
 else if (digitalRead(Freq2_3) == LOW) {
   valueFreq2 = 3;
 }
 else if (digitalRead(Freq2_4) == LOW) {
   valueFreq2 = 4;
 }
 else if (digitalRead(Freq2_5) == LOW) {
   valueFreq2 = 5;
 }
 else if (digitalRead(Freq2_6) == LOW) {
   valueFreq2 = 6;
 }
 else if (digitalRead(Freq2_7) == LOW) {
   valueFreq2 = 7;
 }
 else if (digitalRead(Freq2_8) == LOW) {
   valueFreq2 = 8;
 }
 else if (digitalRead(Freq2_9) == LOW) {
   valueFreq2 = 9;
 }
 else {
   valueFreq2 = 0;
 }
 return valueFreq2;
}

int inputFreq3()
{
 int valueFreq3;
 if (digitalRead(Freq3_1) == LOW) {
   valueFreq3 = 1;
 }
 else if (digitalRead(Freq3_2) == LOW) {
   valueFreq3 = 2;
 }
 else if (digitalRead(Freq3_3) == LOW) {
   valueFreq3 = 3;
 }
 else if (digitalRead(Freq3_4) == LOW) {
   valueFreq3 = 4;
 }
 else if (digitalRead(Freq3_5) == LOW) {
   valueFreq3 = 5;
 }
 else if (digitalRead(Freq3_6) == LOW) {
   valueFreq3 = 6;
 }
 else if (digitalRead(Freq3_7) == LOW) {
   valueFreq3 = 7;
 }
 else if (digitalRead(Freq3_8) == LOW) {
   valueFreq3 = 8;
 }
 else if (digitalRead(Freq3_9) == LOW) {
   valueFreq3 = 9;
 }
 else {
   valueFreq3 = 0;
 }
 return valueFreq3;
}

int inputFreq4()
{
 int valueFreq4;
 if (digitalRead(Freq4_00) == LOW) {
   valueFreq4 = 0;
 }
 else if (digitalRead(Freq4_50) == LOW) {
   valueFreq4 = 2;
 }
 else if (digitalRead(Freq4_75) == LOW) {
   valueFreq4 = 3;
 }
 else {
   valueFreq4 = 1;
 }
 return valueFreq4;
}

int inputMode()
{
 int valueMode;
 if (digitalRead(Mode_1) == HIGH && digitalRead(Mode_2) == HIGH) {
   valueMode = 0;
 }
 else if (digitalRead(Mode_1) == LOW && digitalRead(Mode_2) == HIGH) {
   valueMode = 1;
 }
 else if (digitalRead(Mode_1) == LOW && digitalRead(Mode_2) == LOW){
   valueMode = 2;
 }
 return valueMode;
}

int inputPreset()
{
 int valuePreset;
 if (PINA == B11111110) {
   valuePreset = 0;
 }
 if (PINA == B11111101) {
   valuePreset = 1;
 }
 if (PINA == B11111100) {
   valuePreset = 2;
 }
 if (PINA == B11101111) {
   valuePreset = 3;
 }
 if (PINA == B11101110) {
   valuePreset = 4;
 }
 if (PINA == B11101101) {
   valuePreset = 5;
 }
 if (PINA == B11101100) {
   valuePreset = 6;
 }
 if (PINA == B11011111) {
   valuePreset = 7;
 }
 if (PINA == B11011110) {
   valuePreset = 8;
 }
 if (PINA == B11111011) {
   valuePreset = 9;
 }
 if (PINA == B11111010) {
   valuePreset = 10;
 }
 if (PINA == B11111001) {
   valuePreset = 11;
 }
 if (PINA == B11111000) {
   valuePreset = 12;
 }
 if (PINA == B11101011) {
   valuePreset = 13;
 }
 if (PINA == B11101010) {
   valuePreset = 14;
 }
 if (PINA == B11101001) {
   valuePreset = 15;
 }
 if (PINA == B11101000) {
   valuePreset = 16;
 }
 if (PINA == B11011011) {
   valuePreset = 17;
 }
 if (PINA == B11011010) {
   valuePreset = 18;
 }
 if (PINA == B11110111) {
   valuePreset = 19;
 }
 return valuePreset;
}

void loop() {
 DcsBios::loop();
 tm.runTimers();

}

void setVHF(int timer){
//Adjust frequency selector #1
   if (Freq1_DCS < inputFreq1()) {
   sendDcsBiosMessage("VHFAM_FREQ1", "INC");
 }

 if (Freq1_DCS > inputFreq1()) {
   sendDcsBiosMessage("VHFAM_FREQ1", "DEC");
}

//Adjust frequency selector #2
 if (Freq2_DCS < inputFreq2()) {
   sendDcsBiosMessage("VHFAM_FREQ2", "INC");
 }

 if (Freq2_DCS > inputFreq2()) {
   sendDcsBiosMessage("VHFAM_FREQ2", "DEC");
 }

//Adjust frequency selector #3
 if (Freq3_DCS < inputFreq3()) {
   sendDcsBiosMessage("VHFAM_FREQ3", "INC");
 }

 if (Freq3_DCS > inputFreq3()) {
   sendDcsBiosMessage("VHFAM_FREQ3", "DEC");
 }

//Adjust frequency selector #4
 if (Freq4_DCS < inputFreq4()) {
   sendDcsBiosMessage("VHFAM_FREQ4", "INC");
 }

 if (Freq4_DCS > inputFreq4()) {
   sendDcsBiosMessage("VHFAM_FREQ4", "DEC");
 }

//Adjust Mode
 if (Mode_DCS < inputMode()) {
   sendDcsBiosMessage("VHFAM_MODE", "INC");
 }

 if (Mode_DCS > inputMode()) {
   sendDcsBiosMessage("VHFAM_MODE", "DEC");
 }

//Adjust Prestes
 if (Preset_DCS < inputPreset()) {
   sendDcsBiosMessage("VHFAM_PRESET", "INC");
 }

 if (Preset_DCS > inputPreset()) {
   sendDcsBiosMessage("VHFAM_PRESET", "DEC");
 }

}

 

Now the sharp observer will note a few OBS! in the IF code for the first selector. For some odd reason I could use IF ELSE nor IF al the way on this one. I have probably made a mistake but the code works as it is.

 

A few more photos;

XnEA1Kol.jpg?1

 

Okiliuhl.jpg

 

59CgbWVl.jpg

 

Another thing which I would like to improve later on is for the code to take the easiest way, i.e. when shifting from preset 18 to preset 3 I would like it to step up not down.

 

 

*CDU update*

 

A few weeks ago Tekkx offered to sell me a LCD setup for the CDU running with DCS-BIOS. The setup included the LCD shield and AUNO. I took the offer and it arrived just before easter. He had already loaded the sketch on the UNO so it was literally plug 'n play and it is running;

 

 

This is just from the first tests to it's only taped to the casing and therefore needs a little readjusting. There is a little delay when writting a new screen but I think it is only noticeable when I focus on it. When using the CDU normally then I don't register that it refreshes the screen. Later I will combine the keypresses and LCD code into one and runn off RS485 as well

 

 

Cheers

Hans

Link to comment
Share on other sites

Well done Hans.

 

You really are doing some amazing work. But I need to ask... where do you find this stuff. As you probably know, I made all of my panels right from scratch. I tried very hard to create accurate replicas whenever possible but that was mainly due to a lack of alternatives. I tried to find A10 parts on eBay but, as always, there was nothing to be found. I did find lots of parts and avionics for various airframes but never for an A10.:( I was also concerned with costs but since I never found any A10 parts, I had no point of reference for what I might have to pay for any particular panel.

 

So, if its not too classified Hans... whats your secret? :smilewink:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

draken152, Warhog and GSS Rain many thanks for you kind comments.

 

With regard to getting parts I monitor Ebay (both .com, .de and .co.uk) 3-4 times a day. I got about 100 searches most of them without A-10 in the search name. I also monitor Facebook sites, Viperpits, Flyingfalcon. For the majority of the parts I have gotten they have not been listed as A-10 parts but as something else. I think the KY-58 was listed as radio panel, crypto panel or something.

 

Some of the panels aren't exactly A-10. E.g. the radios most probably aren't since the preset wheel is red. The LOAD button is also deeper in the panel than on the A-10 so perhaps a helo. I got them for $300-400 for the set plus shipping. For free? Absolutely not but I wanted them. There have been a few other sets up which actually was spot on. I think one of the sets sold long after I stopped bidding for something like $1500.

 

Thing is that especially for the radios they may be made into green tagged parts if you have a company certified for doing just that. And then probably the same radio can sell for $10.000. So sometimes you fight professional companies.

 

The IFF can be found on a regular basis on Ebay at anything from $120-150 though the only listed one right now is $400 but it has a yellow tag on it. Normally when I find something I am not allowed to purchase or won't I try to list them in the Ebay section of ED.

 

So unfortunately it's not like I have a site called A-10C_Warthog_panel.com where I can just buy all the stuff and at no cost at all. I consider almost anything at $150-200 plus shipping a good buy. Is that nuts?

Well not exactly sane I guess :-) but it's a decision I have taken some time back. The good thing I think about our small community is that it all depends on what you as a builder wants. Do you want a single frame pit or one that can handle a lot of different airframes, do you even want something to press on at all. Do you want to spend a lot of money for the right feel and clicks, how much are you willing and able to spend, what are you abillities and tools.

 

This is up for the individual builder/simmer to descide.

 

You @Warhog has gotten an amazing skill set and tools for cnc'ing which you have aqquired over working life. @GSS Rain has electronics knowledge like I have never seen before. I would hack off an arm for the combined skills of the two of you. It may have made my life a lot easier and possibly cheaper but possibly also more time consuming I guess :megalol:

 

Cheers

Hans

Link to comment
Share on other sites

You da man Hans. I’ve been admiring your progress and attention to detail. You have a lot of real panels that you converted over to work with DCS World/DCS-Bios which is impressive. Can’t wait to see what you acquire next.

 

It was guys like you, Ian, Warhog, Deadman, and many others who posted pictures in the forums that got me motivated and interested in trying this hobby out for myself.

Link to comment
Share on other sites

Hans,

 

Simply amazing brother. And to have an actual 186 is even better. You have inspired me to learn more about how to code. In fact my Arduino how-to book showed up today and I hope I can use it to help me do my own. I really enjoy watching your build and I can’t tell you how appreciative I am for the assistance you have given me on my own.


Edited by Pavespawn
Link to comment
Share on other sites

  • 4 weeks later...

GSS Rain asked me a question on YT regarding the lighting on the numbers and text. In DCS they are being controlled by two different potentiometers on the Int/Ext light panel. However at least on my two AN/ARC-186's there is only one light.

 

This is how they look when light plate has been powered;

 

PNIupEUl.jpg

 

An yes the second AN/ARC-186 is now also running :-)

 

Next should be the AN/ARC-164 which is a completely different beast.

 

Cheers

Hans

Link to comment
Share on other sites

No I am afraid not. Progress goes quiet slow now. They next project will be the AN/ARC-164 head which hopefully will be a fun challange getting to work. Attached is the pinout of mine which I got of Ebay in the UK probably two years ago.

 

Cheers

Hans

AN_ARC-164(V) UHF pinout - PE101472-001, ver. 2.pdf

Link to comment
Share on other sites

  • 2 weeks later...

Woohoo - AN/ARC-164

 

Alright get my test of the AN/ARC-164 is up and running :-)

 

T6i4ukQl.jpg

 

As can be seen from the pinout in previous post 10 pin of the left connector (P2) are used for several switches, lets call then position pins. I imagined that I could make something that could check each selector/switch for position, store it and then send commands via DCS-BIOS.

Initially my plan was just to use the smaller/greater than which I have been using for the two AN/ARC-186's as well as TACAN, but @molevitch made me aware that you can command the frequencies directly on the AN/ARC-164.

 

The position pins are set with internal pull-up function, while the selector pins (used to check each selector position) are set at output, initially set HIGH. This means that none of the position pins are being pull down to LOW, thus no input reaction is being detected.

 

When I start check the position of e.g. 10MHz switch dial, the code starts by setting the selector output for 10MHz switch dial to LOW. Then it runs through a series of IF commands to determine which of the position pins are LOW and store remember the value for the 10MHz switch dial. The selector pin for 10MHz selector output is then set back to HIGH. The process is repeated for each of the remaining switches.

 

In order for this to work each of the selector outputs needs a diode so it doesn't pull down a different selector than the one I want checked.

 

Now different from the two AN/ARC-186's as well as TACAN code, I tried something different. Instead of checking if DCS value is higher or lower than value of panel, the code just checks if DCS is not the same as panel.

If the are the same nothing happens. If they are different then DCS-BIOS will send the position command directly to DCS. This results in a speedier change as the switch in DCS can jump from preset 1 to 15 in one cycle, instead of having to go through 14 commands of increase.

 

This is second test via USB

 

Not sure why YT hasn't updated the resolution yet so sorry about that.

 

A picture of almost test setup. Mind that right connector isn't on in this picture but the diode are visible

zLRNFqz.jpg

 

This is the USB code. It will of cause be converted into RS485 same as the others. Also it is currently only running on my test Mega so will get a dedicated one.

 

/*
 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"
#include <timer.h>

Timer tm;

// set pin numbers:
const int Value_0 = 54;
const int Value_1 = 55;
const int Value_2 = 56;
const int Value_3 = 57;
const int Value_4 = 58;
const int Value_5 = 59;
const int Value_6 = 60;
const int Value_7 = 61;
const int Value_8 = 62;
const int Value_9 = 63;
const int Main = 44; //Function dial
const int Both = 45; //Function dial
const int Adf = 46; //Function dial
const int Squelch = 43; //Squelch

const int Selector_1 = 30; // 100Mhz
const int Selector_2 = 13; // 10Mhz
const int Selector_3 = 32; // 1MHZ
const int Selector_4 = 33; // 0.1 MHZ
const int Selector_5 = 34; // 0.25 MHZ
const int Selector_6 = 35; //Tone
const int Selector_7 = 36; //Zero
const int Selector_8 = 37; //Test
const int Selector_9 = 38; //Status
const int Selector_10 = 39; //Frequency Mode Dial MNL/PRESET/GRD

//Variables1
int DCS_Preset = 0; //Initial value set for 1
int DCS_100mhz = 0; //Initial value set for 3
int DCS_10mhz = 0; //Initial value set for 0
int DCS_1mhz = 0; //Initial value set for 0
int DCS_0_1mhz = 0; //Initial value set for 0
int DCS_0_25mhz = 0; //Initial value set for 0
int DCS_Tone = 1; // set to off
int DCS_Zero = 0; // set to off
int DCS_Test = 0; // set to off
int DCS_Status = 0; // set to off
int DCS_Mode = 0; // set to off
int DCS_Function = 0; // set to off
int DCS_Squelch = 0; // set to off

int Delay = 1; //Delay before reading

/* paste code snippets from the reference documentation here */
//UHF Prsets
void onUhfPresetSelChange(unsigned int newValue) {
   DCS_Preset = newValue;
}
DcsBios::IntegerBuffer uhfPresetSelBuffer(0x1168, 0xf800, 11, onUhfPresetSelChange);

// UHF 100mhz selector
void onUhf100mhzSelChange(unsigned int newValue) {
   DCS_100mhz = newValue;
}
DcsBios::IntegerBuffer uhf100mhzSelBuffer(0x1170, 0x0300, 8, onUhf100mhzSelChange);

// UHF 10mhz selector
void onUhf10mhzSelChange(unsigned int newValue) {
   DCS_10mhz = newValue;
}
DcsBios::IntegerBuffer uhf10mhzSelBuffer(0x1170, 0x3c00, 10, onUhf10mhzSelChange);

//uhf 1 mhz SELECTOR
void onUhf1mhzSelChange(unsigned int newValue) {
   DCS_1mhz = newValue;
}
DcsBios::IntegerBuffer uhf1mhzSelBuffer(0x1178, 0x0f00, 8, onUhf1mhzSelChange);

//UHF 0.1mhz selector
void onUhfPoint1mhzSelChange(unsigned int newValue) {
   DCS_0_1mhz = newValue;
}
DcsBios::IntegerBuffer uhfPoint1mhzSelBuffer(0x1178, 0xf000, 12, onUhfPoint1mhzSelChange);

//UHF 0.25mhz selector
void onUhfPoint25SelChange(unsigned int newValue) {
   DCS_0_25mhz = newValue;
}
DcsBios::IntegerBuffer uhfPoint25SelBuffer(0x1170, 0xc000, 14, onUhfPoint25SelChange);

//UHF L0ad
DcsBios::Switch2Pos uhfLoad("UHF_LOAD", 21);

//UHF Tone
void onUhfTToneChange(unsigned int newValue) {
   DCS_Tone = newValue;
}
DcsBios::IntegerBuffer uhfTToneBuffer(0x117c, 0x0030, 4, onUhfTToneChange);

//UHF Test
void onUhfTestChange(unsigned int newValue) {
   DCS_Test = newValue;
}
DcsBios::IntegerBuffer uhfTestBuffer(0x117c, 0x0080, 7, onUhfTestChange);

//UHF Status
void onUhfStatusChange(unsigned int newValue) {
   DCS_Status = newValue;
}
DcsBios::IntegerBuffer uhfStatusBuffer(0x117c, 0x0100, 8, onUhfStatusChange);

//UHF Mode
void onUhfModeChange(unsigned int newValue) {
   DCS_Mode = newValue;
}
DcsBios::IntegerBuffer uhfModeBuffer(0x117c, 0x0003, 0, onUhfModeChange);

//UHF Function
void onUhfFunctionChange(unsigned int newValue) {
   DCS_Function = newValue;
}
DcsBios::IntegerBuffer uhfFunctionBuffer(0x117c, 0x000c, 2, onUhfFunctionChange);

//UHF Volumen
DcsBios::Potentiometer uhfVol("UHF_VOL", A15);

//UHF Squelch
void onUhfSquelchChange(unsigned int newValue) {
   DCS_Squelch = newValue;
}
DcsBios::IntegerBuffer uhfSquelchBuffer(0x117c, 0x0040, 6, onUhfSquelchChange);

void setup() {
 DcsBios::setup();

 //Preset inputs
 DDRA = B00000000; // set PINA (digital 29-22) as inputs
 PORTA = B11111111; // Sets (digital 29-22) with internal pull up

 tm.startTimer(200, setUHF);
//Inputs
 pinMode(Value_0, INPUT_PULLUP);
 pinMode(Value_1, INPUT_PULLUP);
 pinMode(Value_2, INPUT_PULLUP);
 pinMode(Value_3, INPUT_PULLUP);
 pinMode(Value_4, INPUT_PULLUP);
 pinMode(Value_5, INPUT_PULLUP);
 pinMode(Value_6, INPUT_PULLUP);
 pinMode(Value_7, INPUT_PULLUP);
 pinMode(Value_8, INPUT_PULLUP);
 pinMode(Value_9, INPUT_PULLUP);
 pinMode(Main, INPUT_PULLUP);
 pinMode(Both, INPUT_PULLUP);
 pinMode(Adf, INPUT_PULLUP);
 pinMode(Squelch, INPUT_PULLUP);

 pinMode(Selector_1, OUTPUT);
 pinMode(Selector_2, OUTPUT);
 pinMode(Selector_3, OUTPUT);
 pinMode(Selector_4, OUTPUT);
 pinMode(Selector_5, OUTPUT);
 pinMode(Selector_6, OUTPUT);
 pinMode(Selector_7, OUTPUT);
 pinMode(Selector_8, OUTPUT);
 pinMode(Selector_9, OUTPUT);
 pinMode(Selector_10, OUTPUT);

 digitalWrite(Selector_1, HIGH);
 digitalWrite(Selector_2, HIGH);
 digitalWrite(Selector_3, HIGH);
 digitalWrite(Selector_4, HIGH);
 digitalWrite(Selector_5, HIGH);
 digitalWrite(Selector_6, HIGH);
 digitalWrite(Selector_7, HIGH);
 digitalWrite(Selector_8, HIGH);
 digitalWrite(Selector_9, HIGH);
 digitalWrite(Selector_10, HIGH);
}

int Preset() // Preset selector switch
{
 int valuePreset;
 if (PINA == B11111110) {
   valuePreset = 0;
 }
 if (PINA == B11111100) {
   valuePreset = 1;
 }
 if (PINA == B11111101) {
   valuePreset = 2;
 }
 if (PINA == B11111001) {
   valuePreset = 3;
 }
 if (PINA == B11111000) {
   valuePreset = 4;
 }
 if (PINA == B11111010) {
   valuePreset = 5;
 }
 if (PINA == B11111011) {
   valuePreset = 6;
 }
 if (PINA == B11110011) {
   valuePreset = 7;
 }
 if (PINA == B11110010) {
   valuePreset = 8;
 }
 if (PINA == B11110000) {
   valuePreset = 9;
 }
 if (PINA == B11110001) {
   valuePreset = 10;
 }
 if (PINA == B11110101) {
   valuePreset = 11;
 }
 if (PINA == B11110100) {
   valuePreset = 12;
 }
 if (PINA == B11110110) {
   valuePreset = 13;
 }
 if (PINA == B11110111) {
   valuePreset = 14;
 }
 if (PINA == B11100111) {
   valuePreset = 15;
 }
 if (PINA == B11100110) {
   valuePreset = 16;
 }
 if (PINA == B11100100) {
   valuePreset = 17;
 }
 if (PINA == B11100101) {
   valuePreset = 18;
 }
 if (PINA == B11100001) {
   valuePreset = 19;
 }
 return valuePreset;
}

int First_selector() //Check 1st selector
{
 int value_Selector_1;
 digitalWrite(Selector_1, LOW);
 delay(Delay);

 if (digitalRead(Value_1) == LOW) {
   value_Selector_1 = 0;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_1 = 1;
 }
 if (digitalRead(Value_3) == LOW) {
   value_Selector_1 = 2;
 }
 digitalWrite(Selector_1, HIGH);
 delay(Delay);
 return value_Selector_1;
}

int Second_selector() //Check 2nd selector
{
 int value_Selector_2;
 digitalWrite(Selector_2, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_2 = 0;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_2 = 1;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_2 = 2;
 }
 if (digitalRead(Value_3) == LOW) {
   value_Selector_2 = 3;
 }
 if (digitalRead(Value_4) == LOW) {
   value_Selector_2 = 4;
 }
 if (digitalRead(Value_5) == LOW) {
   value_Selector_2 = 5;
 }
 if (digitalRead(Value_6) == LOW) {
   value_Selector_2 = 6;
 }
 if (digitalRead(Value_7) == LOW) {
   value_Selector_2 = 7;
 }
 if (digitalRead(Value_8) == LOW) {
   value_Selector_2 = 8;
 }
 if (digitalRead(Value_9) == LOW) {
   value_Selector_2 = 9;
 }
 digitalWrite(Selector_2, HIGH);
 delay(Delay);
 return value_Selector_2;
}

int Third_selector() //Check 3rd selector
{
 int value_Selector_3;
 digitalWrite(Selector_3, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_3 = 0;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_3 = 1;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_3 = 2;
 }
 if (digitalRead(Value_3) == LOW) {
   value_Selector_3 = 3;
 }
 if (digitalRead(Value_4) == LOW) {
   value_Selector_3 = 4;
 }
 if (digitalRead(Value_5) == LOW) {
   value_Selector_3 = 5;
 }
 if (digitalRead(Value_6) == LOW) {
   value_Selector_3 = 6;
 }
 if (digitalRead(Value_7) == LOW) {
   value_Selector_3 = 7;
 }
 if (digitalRead(Value_8) == LOW) {
   value_Selector_3 = 8;
 }
 if (digitalRead(Value_9) == LOW) {
   value_Selector_3 = 9;
 }
 digitalWrite(Selector_3, HIGH);
 delay(Delay);
 return value_Selector_3;
}

int Fourth_selector() //Check 4th selector
{
 int value_Selector_4;
 digitalWrite(Selector_4, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_4 = 0;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_4 = 1;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_4 = 2;
 }
 if (digitalRead(Value_3) == LOW) {
   value_Selector_4 = 3;
 }
 if (digitalRead(Value_4) == LOW) {
   value_Selector_4 = 4;
 }
 if (digitalRead(Value_5) == LOW) {
   value_Selector_4 = 5;
 }
 if (digitalRead(Value_6) == LOW) {
   value_Selector_4 = 6;
 }
 if (digitalRead(Value_7) == LOW) {
   value_Selector_4 = 7;
 }
 if (digitalRead(Value_8) == LOW) {
   value_Selector_4 = 8;
 }
 if (digitalRead(Value_9) == LOW) {
   value_Selector_4 = 9;
 }
 digitalWrite(Selector_4, HIGH);
 delay(Delay);
 return value_Selector_4;
}

int Fifth_selector() //Check 5th selector
{
 int value_Selector_5;
 digitalWrite(Selector_5, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_5 = 0;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_5 = 1;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_5 = 2;
 }
 if (digitalRead(Value_3) == LOW) {
   value_Selector_5 = 3;
 }
 digitalWrite(Selector_5, HIGH);
 delay(Delay);
 return value_Selector_5;
}

int Sixth_selector() //Check Tone
{
 int value_Selector_6;
 digitalWrite(Selector_6, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_6 = 2;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_6 = 0;
 }
 if (digitalRead(Value_0) == HIGH && digitalRead(Value_1) == HIGH) {
   value_Selector_6 = 1;
 }
 digitalWrite(Selector_6, HIGH);
 delay(Delay);
 return value_Selector_6;
}

int Eight_selector() //Check Test
{
 int value_Selector_8;
 digitalWrite(Selector_8, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_8 = 1;
 }
 if (digitalRead(Value_0) == HIGH) {
   value_Selector_8 = 0;
 }
 digitalWrite(Selector_8, HIGH);
 delay(Delay);
 return value_Selector_8;
}

int Ninth_selector() //Check Status
{
 int value_Selector_9;
 digitalWrite(Selector_9, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_9 = 1;
 }
 if (digitalRead(Value_0) == HIGH) {
   value_Selector_9 = 0;
 }
 digitalWrite(Selector_9, HIGH);
 delay(Delay);
 return value_Selector_9;
}

int Tenth_selector() //Check Status
{
 int value_Selector_10;
 digitalWrite(Selector_10, LOW);
 delay(Delay);

 if (digitalRead(Value_0) == LOW) {
   value_Selector_10 = 2;
 }
 if (digitalRead(Value_1) == LOW) {
   value_Selector_10 = 1;
 }
 if (digitalRead(Value_2) == LOW) {
   value_Selector_10 = 0;
 }
 digitalWrite(Selector_10, HIGH);
 delay(Delay);
 return value_Selector_10;
}

int Function_selector() //Check Status
{
 int value_Function;

 if (digitalRead(Main) == LOW) {
   value_Function = 1;
 }
 else if (digitalRead(Both) == LOW) {
   value_Function = 2;
 }
 else if (digitalRead(Adf) == LOW) {
   value_Function = 3;
 }
 else {
   value_Function = 0;
 }
 return value_Function;
}

int Squelch_selector() //Check Status
{
 int value_Squelch;

 if (digitalRead(Squelch) == LOW) {
   value_Squelch = 0;
 }
 else {
   value_Squelch = 1;
 }
 return value_Squelch;
}


void loop() {
DcsBios::loop();
tm.runTimers();

}

void setUHF(int timer){
// Check and adjust presets
 if (DCS_Preset != Preset()) {
      if ( Preset() == 0){
   sendDcsBiosMessage("UHF_PRESET_SEL", "0");
 }
      if ( Preset() == 1){
   sendDcsBiosMessage("UHF_PRESET_SEL", "1");
 }
      if ( Preset() == 2){
   sendDcsBiosMessage("UHF_PRESET_SEL", "2");
 }
      if ( Preset() == 3){
   sendDcsBiosMessage("UHF_PRESET_SEL", "3");
 }
      if ( Preset() == 4){
   sendDcsBiosMessage("UHF_PRESET_SEL", "4");
 }
      if ( Preset() == 5){
   sendDcsBiosMessage("UHF_PRESET_SEL", "5");
 }
      if ( Preset() == 6){
   sendDcsBiosMessage("UHF_PRESET_SEL", "6");
 }
      if ( Preset() == 7){
   sendDcsBiosMessage("UHF_PRESET_SEL", "7");
 }
      if ( Preset() == 8){
   sendDcsBiosMessage("UHF_PRESET_SEL", "8");
 }
      if ( Preset() == 9){
   sendDcsBiosMessage("UHF_PRESET_SEL", "9");
 }
      if ( Preset() == 10){
   sendDcsBiosMessage("UHF_PRESET_SEL", "10");
 }
      if ( Preset() == 11){
   sendDcsBiosMessage("UHF_PRESET_SEL", "11");
 }
      if ( Preset() == 12){
   sendDcsBiosMessage("UHF_PRESET_SEL", "12");
 }
      if ( Preset() == 13){
   sendDcsBiosMessage("UHF_PRESET_SEL", "13");
 }
      if ( Preset() == 14){
   sendDcsBiosMessage("UHF_PRESET_SEL", "14");
 }
      if ( Preset() == 15){
   sendDcsBiosMessage("UHF_PRESET_SEL", "15");
 }
      if ( Preset() == 16){
   sendDcsBiosMessage("UHF_PRESET_SEL", "16");
 }
      if ( Preset() == 17){
   sendDcsBiosMessage("UHF_PRESET_SEL", "17");
 }
      if ( Preset() == 18){
   sendDcsBiosMessage("UHF_PRESET_SEL", "18");
 }
      if ( Preset() == 19){
   sendDcsBiosMessage("UHF_PRESET_SEL", "19");
 }
}

// Check and adjust 1st selector
   if (DCS_100mhz != First_selector()) {
    if ( First_selector() == 0){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "0");
 }
    if ( First_selector() == 1){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "1");
 }
    if ( First_selector() == 2){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "2");
 }
    if ( First_selector() == 3){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "3");
 }
    if ( First_selector() == 4){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "4");
 }
    if ( First_selector() == 5){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "5");
 }
    if ( First_selector() == 6){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "6");
 }
    if ( First_selector() == 7){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "7");
 }
    if ( First_selector() == 8){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "8");
 }
    if ( First_selector() == 9){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "9");
 }
}
// Check and adjust 2nd selector
   if (DCS_10mhz != Second_selector()) {
    if ( Second_selector() == 0){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "0");
 }
    if ( Second_selector() == 1){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "1");
 }
    if ( Second_selector() == 2){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "2");
 }
    if ( Second_selector() == 3){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "3");
 }
    if ( Second_selector() == 4){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "4");
 }
    if ( Second_selector() == 5){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "5");
 }
    if ( Second_selector() == 6){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "6");
 }
    if ( Second_selector() == 7){
   sendDcsBiosMessage("UHF_100MHZ_SEL", "7");
 }
    if ( Second_selector() == 8){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "8");
 }
    if ( Second_selector() == 9){
   sendDcsBiosMessage("UHF_10MHZ_SEL", "9");
 }
}

// Check and adjust 3rd selector
   if (DCS_1mhz != Third_selector()) {
    if ( Third_selector() == 0){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "0");
 }
    if ( Third_selector() == 1){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "1");
 }
    if ( Third_selector() == 2){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "2");
 }
    if ( Third_selector() == 3){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "3");
 }
    if ( Third_selector() == 4){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "4");
 }
    if ( Third_selector() == 5){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "5");
 }
    if ( Third_selector() == 6){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "6");
 }
    if ( Third_selector() == 7){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "7");
 }
    if ( Third_selector() == 8){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "8");
 }
    if ( Third_selector() == 9){
   sendDcsBiosMessage("UHF_1MHZ_SEL", "9");
 }
}


// Check and adjust 4th selector
   if (DCS_0_1mhz != Fourth_selector()) {
    if ( Fourth_selector() == 0){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "0");
 }
    if ( Fourth_selector() == 1){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "1");
 }
    if ( Fourth_selector() == 2){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "2");
 }
    if ( Fourth_selector() == 3){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "3");
 }
    if ( Fourth_selector() == 4){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "4");
 }
    if ( Fourth_selector() == 5){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "5");
 }
    if ( Fourth_selector() == 6){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "6");
 }
    if ( Fourth_selector() == 7){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "7");
 }
    if ( Fourth_selector() == 8){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "8");
 }
    if ( Fourth_selector() == 9){
   sendDcsBiosMessage("UHF_POINT1MHZ_SEL", "9");
 }
}

// Check and adjust 5th selector
 if (DCS_0_25mhz != Fifth_selector()) {
   if ( Fifth_selector() == 0){
      sendDcsBiosMessage("UHF_POINT25_SEL", "0");
 }
  if ( Fifth_selector() == 1){
      sendDcsBiosMessage("UHF_POINT25_SEL", "1");
 }
   if ( Fifth_selector() == 2){
      sendDcsBiosMessage("UHF_POINT25_SEL", "2");
 }
   if ( Fifth_selector() == 3){
      sendDcsBiosMessage("UHF_POINT25_SEL", "3");
 }
}

// Check and adjust Tone
 if (DCS_Tone != Sixth_selector()) {
   if ( Sixth_selector() == 0){
      sendDcsBiosMessage("UHF_T_TONE", "0");
 }
  if ( Sixth_selector() == 1){
      sendDcsBiosMessage("UHF_T_TONE", "1");
 }
   if ( Sixth_selector() == 2){
      sendDcsBiosMessage("UHF_T_TONE", "2");
 }
}

// Check and adjust Test
 if (DCS_Test != Eight_selector()) {
   if ( Eight_selector() == 0){
      sendDcsBiosMessage("UHF_TEST", "0");
 }
  if ( Eight_selector() == 1){
      sendDcsBiosMessage("UHF_TEST", "1");
 }
}

// Check and adjust Status
 if (DCS_Status != Ninth_selector()) {
   if ( Ninth_selector() == 0){
      sendDcsBiosMessage("UHF_STATUS", "0");
 }
  if ( Ninth_selector() == 1){
      sendDcsBiosMessage("UHF_STATUS", "1");
 }
}

// Check and adjust Mode
if (DCS_Mode != Tenth_selector()) {
   if ( Tenth_selector() == 0){
      sendDcsBiosMessage("UHF_MODE", "0");
 }
  if ( Tenth_selector() == 1){
      sendDcsBiosMessage("UHF_MODE", "1");
 }
  if ( Tenth_selector() == 2){
      sendDcsBiosMessage("UHF_MODE", "2");
 }
}

// Check and adjust Function
if (DCS_Function != Function_selector()) {
   if ( Function_selector() == 0){
      sendDcsBiosMessage("UHF_FUNCTION", "0");
 }
  if ( Function_selector() == 1){
      sendDcsBiosMessage("UHF_FUNCTION", "1");
 }
  if ( Function_selector() == 2){
      sendDcsBiosMessage("UHF_FUNCTION", "2");
 }
  if ( Function_selector() == 3){
      sendDcsBiosMessage("UHF_FUNCTION", "3");
 }
}

// Check and adjust Squelch
if (DCS_Squelch != Squelch_selector()) {
   if ( Squelch_selector() == 0){
      sendDcsBiosMessage("UHF_SQUELCH", "0");
 }
  if ( Squelch_selector() == 1){
      sendDcsBiosMessage("UHF_SQUELCH", "1");
 }
}

}

 

Note! The Zero, MN SQ and GD SQ are not implemented in DCS at all.

 

Next task is getting the 7-segments up and running with a MAX7219 chip. Found some really small ones but they have 2mm pitch between the pins so are waiting for a senior pit builder from another forum to assist me with the PCB as he has already done them. To be continued.

 

 

Cheers

Hans


Edited by Hansolo
Link to comment
Share on other sites

Hans, you're just too good my friend. Most impressive work.

 

I used those small 7 seg displays for the UHF as well. The hard part, I thought, was designing and cutting the PCB. To my surprise, it was soldering the damn thing that challenged me more than anything else.. Pull out the old microscope for this one.:thumbup:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

John you are too kind Sir.

 

Yes I reckoned the pcb would be a pain hence the reason I reached out to someone who has already done them and they fit the real panel. But now you got me worried about the soldering. Well if it goes bad I can always de-solder it again. Just got hold of a Hakko FR-301. Man that just works beautifully.

 

Again thanks for your nice words.

 

All the best

Hans

Link to comment
Share on other sites

John you are too kind Sir.

 

Yes I reckoned the pcb would be a pain hence the reason I reached out to someone who has already done them and they fit the real panel. But now you got me worried about the soldering. Well if it goes bad I can always de-solder it again. Just got hold of a Hakko FR-301. Man that just works beautifully.

 

Again thanks for your nice words.

 

All the best

Hans

 

The secret to soldering small is a good soldering station and a dissecting microscope. Looks like you now have everything you need to make it happen. Oh, I almost forgot, there’s one more very important tool... “solder wick!”. :music_whistling: I always keep several rolls on hand... you know, just in case. :smilewink:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

  • Recently Browsing   0 members

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