Jump to content

Hansolo

Members
  • Posts

    1775
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Hansolo

  1. It shouldn't pose a problem. I have been running 2x B256A13 boards from brydling. Each of the boards will show up as one joystick controller with 128 inputs. DCS sees all four controllers as 128 inputs. My experience with BBI-32, BU0836X, BU0836A is that the buttons will be assigned individually in DCS, thus you can use input1 as landing gear in the A-10 but as power switch in the Hornet. Cheers Solo
  2. The Thrustmaster MFD's are IIRCC build after the F-16's and are pretty close to spot on in outer dimensions. Cheers Hans
  3. If you use Tetra's RWR mod then there is a TAC VIEWER that lets you know which sounds are for which threat; https://forums.eagle.ru/showthread.php?t=110840 Cheers Solo
  4. Thanks Joe. Very good suggestion to check for special characters. I will try and look into this. It would be cool if we could 'just' get the status of the power to the panel but that sound like a good workaround. Thanks a lot Sir Cheers Hans
  5. Roger now I understand your problem. Then you probabl have to build them yourself or buy real ones. There were a few real ones on Ebay a while back but they were $700 a piece IIRCC. Cheers Hans
  6. DCS-BIOS AN/ARC-164 with 7-segments over RS485 Thanks a lot GSS Rain. I have gotten a little futher Got the PCB's for the 7-segments of a senior member on Viperpits/Flying Falcon. Works great with these; https://www.ebay.com/itm/1-Lot-of-25-Pieces-Avago-HDSP-U503-LED/291589746309?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649 Currently the code for the swiches of the AN/ARC-164 compares to the actual in DCS and then makes a command. I think I will start working on 'just' making them as they reacts in rest of DCS-BIOS i.e. send a command when the switch changes and be done with that. Should clear up the code somewhat. The DISPLAY TEST won't work since the original ones are 16-segments. I'll see f I can dig some of those up. Code for the 7-segments are borrowed from Warhog :-) /* 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 27 /* 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 <LedControl.h> LedControl lc=LedControl(30,31,32,1); //This creates an instance of a single controller named "lc" /* The sequence of pins used above are in the following order... LedControl(DIN,CLK,LOAD,# OF IC's) pin 30 is connected to the DataIn pin 32 is connected to the CLK pin 31 is connected to LOAD the last number...(1) is for how many MAX7219 we have daisy chained. */ #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 = 3; // 100Mhz const int Selector_2 = 4; // 10Mhz const int Selector_3 = 5; // 1MHZ const int Selector_4 = 6; // 0.1 MHZ const int Selector_5 = 7; // 0.25 MHZ const int Selector_6 = 8; //Tone const int Selector_7 = 9; //Zero const int Selector_8 = 10; //Test const int Selector_9 = 11; //Status const int Selector_10 = 12; //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 = 10; //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); //UHF Frequency display void onUhfFrequencyChange(char* newValue) { lc.setChar(0,0,newValue[0],false); lc.setChar(0,1,newValue[1],false); if ( Function_selector() == 0){ lc.setChar(0,2,newValue[2],false); // if radio is off then don't write decimal point } else { lc.setChar(0,2,newValue[2],true); // if radio is ON then write decimal point } lc.setChar(0,3,newValue[4],false); lc.setChar(0,4,newValue[5],false); lc.setChar(0,5,newValue[6],false); } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); //UHF preset display void onUhfPresetChange(char* newValue) { lc.setChar(0,6,newValue[0],false); lc.setChar(0,7,newValue[1],false); } DcsBios::StringBuffer<2> uhfPresetBuffer(0x1188, onUhfPresetChange); void setup() { DcsBios::setup(); //This initializes the MAX7219 and gets it ready of use: lc.shutdown(0,false); //turn on the display lc.setIntensity(0,10);//set the brightness lc.clearDisplay(0); //clear the display //The following series of "lc.setChar" commands are used to display the number 8 in each digit. This allows us to see each that LED segment is actually working. lc.setChar(0,0,'8',false);// The first number...0, means there are no other MAX7219's connected to the one we are using. lc.setChar(0,1,'8',false);// The second number...1, indicates the digit you are sending data too...digit numbering starts at 0. lc.setChar(0,2,'8',false);// The third number in single quotes is the character thats displayed lc.setChar(0,3,'8',false);// The statement... true/false is to turn on or off the decimal point (dp) for that particular digit. lc.setChar(0,4,'8',false); lc.setChar(0,5,'8',false); lc.setChar(0,6,'8',false); lc.setChar(0,7,'8',false); //Preset inputs DDRA = B00000000; // set PINA (digital 29-22) as inputs PORTA = B11111111; // Sets (digital 29-22) with internal pull up tm.startTimer(300, 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_10MHZ_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"); } } } Cheers Hans
  7. What do you mean with blocks off? Doesn't that depends on how big your monitor lua is? Cheers Solo
  8. Hi Jocman, What happens if you remove the external LED? Maybe it's defective. Alternatively try and try another DCS-BIOS led e.g. DcsBios::LED clExtendGear(0x1818, 0x0002, 13); I am afraid I do not have the module so can't test it. Cheers Hans
  9. Hi Jocman, Try this instead; /* 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" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos scMasterCautionBtn("SC_MASTER_CAUTION_BTN", 12); DcsBios::LED scMasterCautionLed(0x1814, 0x0800, 13); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } From the picture it looks like you have connected the Master Caution button to pin no 12 and Master Caution LED to pin 13 (onboard LED). You can use pins 15 and 16 but there are analog A1 and A2. Cheers Solo
  10. Really nice solution WhoMadeWho. I will definitly check out that link. Thanks a lot Sir. Cheers Hans
  11. Try and show us the complete sketch you are loading to the Nano along with a few pictures showing the wirings Cheers Solo
  12. Sweet jesus that looks amazing Calum :worthy: This is IMHO the most accurate home made AN/ARC-186 panel I have seen by far. The construction looks very familiar to the real ones I have. Really nice job indeed. I guess that 20 position rotary haven't been cheap :cry: Oh it probably too late and I forgot all about it. DCS has an error in the AN/ARC-186's. On the first channel selector the number 8 doesn't exist on the real ones. No biggy. Did you 3D print the lid on the AN/ARC-164? Very nice build as well. If you can you may want to exchange the Squelch out to a smaller one as it looks a little big. Can't wait to see the result when you fire them up. The annunciators looks awesome as well. Hats of to you and you skills my friend. Really beautiful job there. Have a great weekend and take a well deserved beer on me :-) All the best Hans
  13. Try this. Arrange the monitors in Windows monitor setup as shown in WBK setup.png. Add the .lua file to DCSW install folder e.g. ...Eagle Dynamics\DCS World\Config\MonitorSetup Select the file from DCSW option-system and set resolution to 2646*1024. Hope you caught something exotic on the fishing trip Cheers Solo 1Camera + MFCD on second screen.lua
  14. Simply just beautiful John. I think many of us has been following you through the years and been amazed by the dedication and skillset you have. Truly inspiring and I look forward to see the next pit project you decide on. All the very best Hans
  15. That is some serious work you are putting into this AndrewW :thumbup: Hats of to you Sir for taking the workload on this. There's got be a ton of guys owing beers. Unfortunately unable to rep you for your works as this function has been turned off. Keep up the good work Sir Cheers Solo
  16. Hi Molevitch, I think we need to find a pinout for the Mega you are using. The one I am looking at (http://osoyoo.com/wp-content/uploads/2017/08/arduino_mega_2560_pinout.png) I can actually only find PORTD D0-3 (pins 21-18 ) & D7 (pin 38 ). Secondly you have a small issue in the comparrision part; // Check and adjust 2nd dial if (DCS_valueDial_2 == inputDial_2()) { if ( inputDial_2() == 0){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "0"); } if ( inputDial_2() == 1){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "10"); } if ( inputDial_2() == 2){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "20"); } if ( inputDial_2() == 3){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "30"); } if ( inputDial_2() == 4){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "40"); } if ( inputDial_2() == 5){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "50"); } if ( inputDial_2() == 6){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "60"); } if ( inputDial_2() == 7){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "70"); } if ( inputDial_2() == 8){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "80"); } if ( inputDial_2() == 9){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "90"); } } Isn't correct. What you are doing is saying "If DCS value and the hardware dial are EQUAL (==) then adjust and send new messages" What you should be saying is "If DCS value is NOT EQUAL (!=) to hardware dials then adjust and send new message"; // Check and adjust 2nd dial if (DCS_valueDial_2 != inputDial_2()) { Notice == is exchanged with !=. Checking the inputs are easily done with a small multimeter. Doesn't have to cost a fortune, just need to be able to measure VDC. Place the black probe in GND on the Arduino and the measure the voltage on each input with the red probe. If nothing is activated then all the pins on a port should 5VDC Cheers Solo
  17. Depends what you want to really but an option is to go for something like this; https://www.ebay.com/itm/1pcs-AC-125V-RS26-1-Pole-Position-12-Switch-Band-Rotary-Channel-Thread-Plastic-M/152357374281?epid=508922262&hash=item2379350949:g:KPkAAOSwJ7RYUm1g These ones are 12 position but there is a washer with a tap so that you can lock how many positions you want. I have marked the washer in the attached photo. Cheers Solo
  18. Romeokilo, this is one of the most complete pits I think we have around. Beautiful all the way. A lot of us has been watching from the beginning and learned from your ideas. Thanks a lot for that. I am sure that the lessons learned along the way will make the Hornet pit easier. Excellent work Sir. Cheers Hans
  19. Hi Molevitch, To the best of my knowledge there is are two small mistakes. First you are are defining two variables with the same name (valueDial_2). I don't think you can do that. Second is that you are check the position of the dial but you are not using the information to anything. You are missing the comparison part I have for simplicity renamed one of the variables which is used for getting the info out of DCS and added the comparision code /* 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" int DCS_valueDial_2; // renamed this to be more saying (to me) /* paste code snippets from the reference documentation here */ void onArcMain10khzChange(unsigned int newValue) { DCS_valueDial_2 = newValue; } DcsBios::IntegerBuffer arcMain10khzBuffer(0x26a2, 0x00f0, 4, onArcMain10khzChange); const byte arc9ModePins[4] = {10, 11, 12, 13}; DcsBios::SwitchMultiPos arc9Mode("ARC9_MODE", arc9ModePins, 4); const byte arc9MainBackupPins[2] = {8, 9}; DcsBios::SwitchMultiPos arc9MainBackup("ARC9_MAIN_BACKUP", arc9MainBackupPins, 2); const byte arc9TlfTlgPins[2] = {7, 6}; DcsBios::SwitchMultiPos arc9TlfTlg("ARC9_TLF_TLG", arc9TlfTlgPins, 2); //DcsBios:otentiometer arc9Vol("ARC9_VOL", A; void setup() { DcsBios::setup(); //ARK-9 DIAL_2 inputs- 0-90 kHz Main DDRD = B00000000; // set PIND (digital 21-1 as inputs PORTD = B11111111; // Sets (digital 21-1 with internal pull up } int inputDial_2() { int valueDial_2; if (PIND == B11111111) { valueDial_2 = 0; } if (PIND == B01111111) { valueDial_2 = 1; } if (PIND == B10111111) { valueDial_2 = 2; } if (PIND == B00111111) { valueDial_2 = 3; } if (PIND == B10101111) { valueDial_2 = 4; } if (PIND == B00101111) { valueDial_2 = 5; } if (PIND == B10011111) { valueDial_2 = 6; } if (PIND == B00011111) { valueDial_2 = 7; } if (PIND == B10001111) { valueDial_2 = 8; } if (PIND == B00001111) { valueDial_2 = 9; } return valueDial_2; } void loop() { DcsBios::loop(); // Check and adjust 2nd dial if (DCS_valueDial_2 != inputDial_2()) { if ( inputDial_2() == 0){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "0"); } if ( inputDial_2() == 1){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "1"); } if ( inputDial_2() == 2){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "2"); } if ( inputDial_2() == 3){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "3"); } if ( inputDial_2() == 4){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "4"); } if ( inputDial_2() == 5){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "5"); } if ( inputDial_2() == 6){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "6"); } if ( inputDial_2() == 7){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "7"); } if ( inputDial_2() == 8){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "8"); } if ( inputDial_2() == 9){ sendDcsBiosMessage("ARC_MAIN_10KHZ", "9"); } } } The code compiles at my end but that doesn't mean it works :-) I personally still belives you need the timer because I think this will spam the communication with new commands as the arduino is so fast. Try it out and see if you get a result. Cheers Solo
  20. Dear Ian, Good to hear from you again. I can only try to image how frustrating the past month has been but I am very happy that your future looks a lot brighter now so a warm congratulation on your new job. I cannot image a better and more well deserved vacation for you than to go see John and what he has accomplished with DCS-BIOS. We all look forward to see what you have cocking in the future DCS-BIOS 2 considering what you have made possible with DCS-BIOS (1). A warm welcome back Sir and once again congratulations on your new job. Have a wonderful vacation in Canada. All the best Hans
  21. Adjust Windows so that the 1366*768 is to the left and place the 1280*1024 to the right of it. Then adjust your monitor.lua to have the main screen starting at 0,0 size 1366*768 and place the MFCD's on your right monitor; There should be a ton of info here; https://forums.eagle.ru/showthread.php?t=70716 Otherwise I can send you my setup tomorrow evening assuming you are running the A-10C. Running a 4K monitor for main DCS cockpit and a 1680*1050 for Helios and MFCD's. Cheers Solo
  22. 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
  23. Woohoo - AN/ARC-164 Alright get my test of the AN/ARC-164 is up and running :-) 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 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
  24. Yes sir very much alive and kicking. And yes got the CDU (not exactly the A-10 one though) up and running; https://forums.eagle.ru/showpost.php?p=3236594&postcount=159 Cheers Hans
  25. Looking forward for it molevitch. You just gave me a great idea. I am currently working on my AN/ARC-164 in test mode and had some of the dials running yesterday using basically same setup as my TACAN and AN/ARC-186's. But now realised that the UHF (AN/ARC-164) also has the possibility to send the position directly. Made a small test tonight and that worked perfectly instead of INC/DEC. Thanks a lot Sir :thumbup: Cheers Hans
×
×
  • Create New...