Jump to content

Hansolo

Members
  • Posts

    1775
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Hansolo

  1. Do you have potentiometers in your button boxes? If yes then that may be the issue. I experienced this a long time back; https://forums.eagle.ru/showpost.php?p=3020643&postcount=127 I believe Ian already included something to deal with the jittering potentiometers. If you don't have any potentiometer, then nevermind the above :-) Cheers Hans
  2. Which version of DCS and DCS-BIOS are you running Les? I an running DCSW OB 2.5.5.41371 with DCS-BIOS v0.7.1 and don't have any issues. I can see from other threats that you recently started using Helios. Have you considered this to be the issue? I seem to recall that e.g. Jetseat/UR had some difficulties if the sequence in the export.lua is not correct. Cheers Hans
  3. I guess it should work if your activation of the switch first sends the command to lift the guard, a small delay followed the activation command. Alteratively you may use a MON-OFF-ON switch, so that the MON function is activated when the guard is down, once guard is being lifted the MON releases and send the command to DCS for lifting the guard, then activation of the ON send the command for aactivation of the function. I did this based upon advice from Deadman in this post and it works great; https://forums.eagle.ru/showpost.php?p=3411577&postcount=196 Cheers Hans
  4. Hello Sir. For the most part I have removed all the original wiring and 'just' used the rotaries, toggle etc. A few of them had the original amphenol connector but I removed those. First the mating connector is very pricy and difficult to find. Secondly I have all the electronics on each panel. All the best Hans
  5. Outstanding mole. Yeah sorry for late reply. Been quite busy lately. Just replied to your PM, sorry for the delay. And no my pit has run to a grinding halt at the moment, but I hope to get a little done during winter :cry: Have a great weekend. Cheers Hans
  6. Hi mole, I tried to load your sketch but can't replicate the problem; I did a few alterations to your sketch. First I rename the Timer.h, which is most likely a name difference between yours an my library. I don't think your Timer.h does anything for you as it is not called again later in your sketch, and the time is not defined. The I added initial positions so that I could get a stable output. The only pin I couldn't get to work is pin16, but what the latest of the 'old' DCS-BIOS it looks like that was supposed to be a 3-position switch Here is your sketch with my few alterations /* 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). */ /* 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 124 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 /*#define DCSBIOS_IRQ_SERIAL*/ #include "DcsBios.h" #include <timer.h> //Mine is called timer.h not Timer.h hence the renaming //Added initial positions to have a stable test setup int DCS_valueDial_1=0; // MAIN/1 0-1KHZ DIAL/ARK-9 TUNE int DCS_valueDial_2=0; // MAIN/1 10KHZ DIAL int DCS_valueDial_3=1; // MAIN/1 100KHZ DIAL int DCS_valueDial_4=0; // BACK/1 0-1KHZ DIAL/ARK-9 TUNE int DCS_valueDial_5=0; // BACK/1 10KHZ DIAL int DCS_valueDial_6=1; // BACK/1 100KHZ DIAL /* paste code snippets from the reference documentation here */ /*/////////////////////////////////* Switches and toggles*/ const byte arc9ModePins[4] = {6, 7, 8, 9}; DcsBios::SwitchMultiPos arc9Mode("ARC9_MODE", arc9ModePins, 4); const byte arc9MainBackupPins[2] = {3, 4}; DcsBios::SwitchMultiPos arc9MainBackup("ARC9_MAIN_BACKUP", arc9MainBackupPins, 2); const byte arc9TlfTlgPins[2] = {14,15}; DcsBios::SwitchMultiPos arc9TlfTlg("ARC9_TLF_TLG", arc9TlfTlgPins, 2); const byte arc9LoopPins[1] = {16}; //This appears to to have been a 3 position originally DcsBios::SwitchMultiPos arc9Loop("ARC_9_LOOP", arc9LoopPins, 1); ///////////////////////////////////////////// void onArc9MainTuneChange(unsigned int newValue) { DCS_valueDial_1 = newValue; } DcsBios::IntegerBuffer arc9MainTuneBuffer(0x2672, 0xffff, 0, onArc9MainTuneChange); void onArcMain10khzChange(unsigned int newValue) { DCS_valueDial_2 = newValue; } DcsBios::IntegerBuffer arcMain10khzBuffer(0x26a2, 0x00f0, 4, onArcMain10khzChange); void onArcMain100khzChange(unsigned int newValue) { DCS_valueDial_3 = newValue; } DcsBios::IntegerBuffer arcMain100khzBuffer(0x26a2, 0x000f, 0, onArcMain100khzChange); void onArc9BckTuneChange(unsigned int newValue) { DCS_valueDial_4 = newValue; } DcsBios::IntegerBuffer arc9BckTuneBuffer(0x2670, 0xffff, 0, onArc9BckTuneChange); void onArcBck10khzChange(unsigned int newValue) { DCS_valueDial_5 = newValue; } DcsBios::IntegerBuffer arcBck10khzBuffer(0x26a0, 0xf000, 12, onArcBck10khzChange); void onArcBck100khzChange(unsigned int newValue) { DCS_valueDial_6 = newValue; } DcsBios::IntegerBuffer arcBck100khzBuffer(0x26a0, 0x0f00, 8, onArcBck100khzChange); void setup() { DcsBios::setup(); //ARK-9 DIAL_1 MAIN INPUTS 0-9.5/ -10-+20 DDRC = B00000000; // set PIND (digital 37-30) as inputs PORTC = B11111111; // Sets (digital 37-30) with internal pull up //ARK-9 DIAL_2 MAIN inputs- 0-90 kHz Main DDRD = B00000000; // set PIND (digital 38+21-18) as inputs PORTD = B11111111; // Sets (digital 38+21-18) with internal pull up //ARK-9 DIAL_3 MAIN inputs- 100 kHz Main DDRA = B00000000; // set PINA (digital 29-22) as inputs PORTA = B11111111; // Sets (digital 29-22) with internal pull up //ARK-9 DIAL_4 BACK INPUTS 0-9.5/ -10-+20 DDRB = B00000000; // set PIND (digital 37-30) as inputs PORTB = B11111111; // Sets (digital 37-30) with internal pull up //ARK-9 DIAL_5 BACK inputs- 0-90 kHz Main DDRL = B00000000; // set PIND (digital 38+21-18) as inputs PORTL = B11111111; // Sets (digital 38+21-18) with internal pull up //ARK-9 DIAL_6 BACK inputs- 100 kHz Main DDRK = B00000000; // set PINA (digital 29-22) as inputs PORTK = B11111111; // Sets (digital 29-22) with internal pull up } /////MAIN FREQUENCY TUNE DIAL; DIAL 1 /////////////////////// int inputDial_1() { int valueDial_1; if (PINC == B11111111) { valueDial_1 = 0; } if (PINC == B11111110) { valueDial_1 = 1; } if (PINC == B11101111) { valueDial_1 = 2; } if (PINC == B11101110) { valueDial_1 = 3; } if (PINC == B11111101) { valueDial_1 = 4; } if (PINC == B11111100) { valueDial_1 = 5; } if (PINC == B11101101) { valueDial_1 = 6; } if (PINC == B11101100) { valueDial_1 = 7; } if (PINC == B11110101) { valueDial_1 = 8; } if (PINC == B11110100) { valueDial_1 = 9; } if (PINC == B11100101) { valueDial_1 = 10; } if (PINC == B11100100) { valueDial_1 = 11; } if (PINC == B11111001) { valueDial_1 = 12; } if (PINC == B11111000) { valueDial_1 = 13; } if (PINC == B11101001) { valueDial_1 = 14; } if (PINC == B11101000) { valueDial_1 = 15; } if (PINC == B11110001) { valueDial_1 = 16; } if (PINC == B11110000) { valueDial_1 = 17; } if (PINC == B11100001) { valueDial_1 = 18; } if (PINC == B11100000) { valueDial_1 = 19; } return valueDial_1; } ///// END OF MAIN FREQUENCY TUNER DIAL_1/////////////////// /////MAIN 10KHZ ROTARY DIAL/////////////////////////////////////////////////// //ARK-9 DIAL_2 inputs- 0-90 kHz Main //DDRB = B00000000; // set PIND digital 53-50,10-13 as inputs //PORTB = B11111111; // Sets digital 53-50,10-13 with internal pull up //} int inputDial_2() { int valueDial_2; if (PIND == B11111111) { valueDial_2 = 0; } if (PIND == B11110111) { valueDial_2 = 1; } if (PIND == B11111011) { valueDial_2 = 2; } if (PIND == B11110011) { valueDial_2 = 3; } if (PIND == B01111010) { valueDial_2 = 4; } if (PIND == B01110010) { valueDial_2 = 5; } if (PIND == B01111001) { valueDial_2 = 6; } if (PIND == B01110001) { valueDial_2 = 7; } if (PIND == B01111000) { valueDial_2 = 8; } if (PIND == B01110000) { valueDial_2 = 9; } return valueDial_2; } ////222222//END OF MAIN 10KHZ ROTARY DIAL_2//////////////// //33333///MAIN 100KHZ DIAL_3 /////////////////////// int inputDial_3() { int valueDial_3; if (PINA == B11111111) { valueDial_3 = 1; } if (PINA == B11110111) { valueDial_3 = 2; } if (PINA == B11111110) { valueDial_3 = 3; } if (PINA == B11110110) { valueDial_3 = 4; } if (PINA == B11111010) { valueDial_3 = 5; } if (PINA == B11110010) { valueDial_3 = 6; } if (PINA == B11111100) { valueDial_3 = 7; } if (PINA == B11110100) { valueDial_3 = 8; } if (PINA == B11111000) { valueDial_3 = 9; } if (PINA == B11110000) { valueDial_3 = 10; } if (PINA == B11101111) { valueDial_3 = 11; } if (PINA == B11100111) { valueDial_3 = 12; } if (PINA == B11101110) { valueDial_3 = 13; } if (PINA == B11100110) { valueDial_3 = 14; } if (PINA == B11101010) { valueDial_3 = 15; } if (PINA == B11100010) { valueDial_3 = 16; } if (PINA == B11101100) { valueDial_3 = 17; } if (PINA == B11100100) { valueDial_3 = 18; } if (PINA == B11100100) { valueDial_3 = 19; } if (PINA == B11100100) { valueDial_3 = 20; } return valueDial_3; } ////333333333////END OF MAIN 100KHZ DIAL 3 /////BACK FREQUENCY TUNE DIAL; DIAL 1 /////////////////////// int inputDial_4() { int valueDial_4; if (PINB == B11111111) { valueDial_4 = 0; } if (PINB == B11111110) { valueDial_4 = 1; } if (PINB == B11101111) { valueDial_4 = 2; } if (PINB == B11101110) { valueDial_4 = 3; } if (PINB == B11111101) { valueDial_4 = 4; } if (PINB == B11111100) { valueDial_4 = 5; } if (PINB == B11101101) { valueDial_4 = 6; } if (PINB == B11101100) { valueDial_4 = 7; } if (PINB == B11110101) { valueDial_4 = 8; } if (PINB == B11110100) { valueDial_4 = 9; } if (PINB == B11100101) { valueDial_4 = 10; } if (PINB == B11100100) { valueDial_4 = 11; } if (PINB == B11111001) { valueDial_4 = 12; } if (PINB == B11111000) { valueDial_4 = 13; } if (PINB == B11101001) { valueDial_4 = 14; } if (PINB == B11101000) { valueDial_4 = 15; } if (PINB == B11110001) { valueDial_4 = 16; } if (PINB == B11110000) { valueDial_4 = 17; } if (PINB == B11100001) { valueDial_4 = 18; } if (PINB == B11100000) { valueDial_4 = 19; } return valueDial_4; } ///// END OF BACK FREQUENCY TUNER DIAL_1/////////////////// /////BACK 10KHZ ROTARY DIAL 5/////////////////////////////////////////////////// //ARK-9 DIAL_5 inputs- 0-90 kHz BACK int inputDial_5() { int valueDial_5; if (PINL == B11111111) { valueDial_5 = 0; } if (PINL == B11110111) { valueDial_5 = 1; } if (PINL == B11111011) { valueDial_5 = 2; } if (PINL == B11110011) { valueDial_5 = 3; } if (PINL == B11101010) { valueDial_5 = 4; } if (PINL == B11100010) { valueDial_5 = 5; } if (PINL == B11101001) { valueDial_5 = 6; } if (PINL == B11100001) { valueDial_5 = 7; } if (PINL == B11101000) { valueDial_5 = 8; } if (PINL == B11100000) { valueDial_5 = 9; } return valueDial_5; } ////555555//END OF BACK 10KHZ ROTARY DIAL_5//////////////// //666666///BACK 100KHZ DIAL_6 /////////////////////// int inputDial_6() { int valueDial_6; if (PINK == B11111111) { valueDial_6 = 1; } if (PINK == B11110111) { valueDial_6 = 2; } if (PINK == B11111110) { valueDial_6 = 3; } if (PINK == B11110110) { valueDial_6 = 4; } if (PINK == B11111010) { valueDial_6 = 5; } if (PINK == B11110010) { valueDial_6 = 6; } if (PINK == B11111100) { valueDial_6 = 7; } if (PINK == B11110100) { valueDial_6 = 8; } if (PINK == B11111000) { valueDial_6 = 9; } if (PINK == B11110000) { valueDial_6 = 10; } if (PINK == B11101111) { valueDial_6 = 11; } if (PINK == B11100111) { valueDial_6 = 12; } if (PINK == B11101110) { valueDial_6 = 13; } if (PINK == B11100110) { valueDial_6 = 14; } if (PINK == B11101010) { valueDial_6 = 15; } if (PINK == B11100010) { valueDial_6 = 16; } if (PINK == B11101100) { valueDial_6 = 17; } if (PINK == B11100100) { valueDial_6 = 18; } if (PINK == B11100100) { valueDial_6 = 19; } if (PINK == B11100100) { valueDial_6 = 20; } return valueDial_6; } ////666666////END OF BACK 100KHZ DIAL 6 void loop() { DcsBios::loop(); // Check and adjust 1st dial if (DCS_valueDial_1 != inputDial_1()) { if ( inputDial_1() == 0) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "0"); } if ( inputDial_1() == 1) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "3200"); } if ( inputDial_1() == 2) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "6400"); } if ( inputDial_1() == 3) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "9600"); } if ( inputDial_1() == 4) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "12800"); } if ( inputDial_1() == 5) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "16000"); } if ( inputDial_1() == 6) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "19200"); } if ( inputDial_1() == 7) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "22400"); } if ( inputDial_1() == 8) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "25600"); } if ( inputDial_1() == 9) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "28800"); } if ( inputDial_1() == 10) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "32000"); } if ( inputDial_1() == 11) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "35200"); } if ( inputDial_1() == 12) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "38400"); } if ( inputDial_1() == 13) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "41600"); } if ( inputDial_1() == 14) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "44800"); } if ( inputDial_1() == 15) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "48000"); } if ( inputDial_1() == 16) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "51200"); } if ( inputDial_1() == 17) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "54400"); } if ( inputDial_1() == 18) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "57600"); } if ( inputDial_1() == 19) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "60800"); } } // 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"); } } // Check and adjust 3RD dial if (DCS_valueDial_3 != inputDial_3()) { if ( inputDial_3() == 3) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "1"); } if ( inputDial_3() == 4) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "2"); } if ( inputDial_3() == 5) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "3"); } if ( inputDial_3() == 6) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "4"); } if ( inputDial_3() == 7) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "5"); } if ( inputDial_3() == 8) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "6"); } if ( inputDial_3() == 9) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "7"); } if ( inputDial_3() == 10) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "8"); } if ( inputDial_3() == 11) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "9"); } if ( inputDial_3() == 12) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "10"); } if ( inputDial_3() == 13) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "11"); } if ( inputDial_3() == 14) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "12"); } if ( inputDial_3() == 15) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "13"); } if ( inputDial_3() == 16) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "14"); } if ( inputDial_3() == 17) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "15"); } if ( inputDial_3() == 18) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "16"); } if ( inputDial_3() == 19) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "17"); } if ( inputDial_3() == 20) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "18"); } if ( inputDial_3() == 1) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "19"); } if ( inputDial_3() == 2) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "20"); } } // Check and adjust 4TH dial if (DCS_valueDial_4 != inputDial_4()) { if ( inputDial_4() == 0) { sendDcsBiosMessage("ARC9_BCK_TUNE", "0"); } if ( inputDial_4() == 1) { sendDcsBiosMessage("ARC9_BCK_TUNE", "3200"); } if ( inputDial_4() == 2) { sendDcsBiosMessage("ARC9_BCK_TUNE", "6400"); } if ( inputDial_4() == 3) { sendDcsBiosMessage("ARC9_BCK_TUNE", "9600"); } if ( inputDial_4() == 4) { sendDcsBiosMessage("ARC9_BCK_TUNE", "12800"); } if ( inputDial_4() == 5) { sendDcsBiosMessage("ARC9_BCK_TUNE", "16000"); } if ( inputDial_4() == 6) { sendDcsBiosMessage("ARC9_BCK_TUNE", "19200"); } if ( inputDial_4() == 7) { sendDcsBiosMessage("ARC9_BCK_TUNE", "22400"); } if ( inputDial_4() == 8) { sendDcsBiosMessage("ARC9_BCK_TUNE", "25600"); } if ( inputDial_4() == 9) { sendDcsBiosMessage("ARC9_BCK_TUNE", "28800"); } if ( inputDial_4() == 10) { sendDcsBiosMessage("ARC9_BCK_TUNE", "32000"); } if ( inputDial_4() == 11) { sendDcsBiosMessage("ARC9_BCK_TUNE", "35200"); } if ( inputDial_4() == 12) { sendDcsBiosMessage("ARC9_BCK_TUNE", "38400"); } if ( inputDial_4() == 13) { sendDcsBiosMessage("ARC9_BCK_TUNE", "41600"); } if ( inputDial_4() == 14) { sendDcsBiosMessage("ARC9_BCK_TUNE", "44800"); } if ( inputDial_4() == 15) { sendDcsBiosMessage("ARC9_BCK_TUNE", "48000"); } if ( inputDial_4() == 16) { sendDcsBiosMessage("ARC9_BCK_TUNE", "51200"); } if ( inputDial_4() == 17) { sendDcsBiosMessage("ARC9_BCK_TUNE", "54400"); } if ( inputDial_4() == 18) { sendDcsBiosMessage("ARC9_BCK_TUNE", "57600"); } if ( inputDial_4() == 19) { sendDcsBiosMessage("ARC9_BCK_TUNE", "60800"); } } // Check and adjust 5TH dial if (DCS_valueDial_5 != inputDial_5()) { if ( inputDial_5() == 0) { sendDcsBiosMessage("ARC_BCK_10KHZ", "0"); } if ( inputDial_5() == 1) { sendDcsBiosMessage("ARC_BCK_10KHZ", "1"); } if ( inputDial_5() == 2) { sendDcsBiosMessage("ARC_BCK_10KHZ", "2"); } if ( inputDial_5() == 3) { sendDcsBiosMessage("ARC_BCK_10KHZ", "3"); } if ( inputDial_5() == 4) { sendDcsBiosMessage("ARC_BCK_10KHZ", "4"); } if ( inputDial_5() == 5) { sendDcsBiosMessage("ARC_BCK_10KHZ", "5"); } if ( inputDial_5() == 6) { sendDcsBiosMessage("ARC_BCK_10KHZ", "6"); } if ( inputDial_5() == 7) { sendDcsBiosMessage("ARC_BCK_10KHZ", "7"); } if ( inputDial_5() == 8) { sendDcsBiosMessage("ARC_BCK_10KHZ", "8"); } if ( inputDial_5() == 9) { sendDcsBiosMessage("ARC_BCK_10KHZ", "9"); } } // Check and adjust 6TH dial if (DCS_valueDial_6 != inputDial_6()) { if ( inputDial_6() == 3) { sendDcsBiosMessage("ARC_BCK_100KHZ", "1"); } if ( inputDial_6() == 4) { sendDcsBiosMessage("ARC_BCK_100KHZ", "2"); } if ( inputDial_6() == 5) { sendDcsBiosMessage("ARC_BCK_100KHZ", "3"); } if ( inputDial_6() == 6) { sendDcsBiosMessage("ARC_BCK_100KHZ", "4"); } if ( inputDial_6() == 7) { sendDcsBiosMessage("ARC_BCK_100KHZ", "5"); } if ( inputDial_6() == 8) { sendDcsBiosMessage("ARC_BCK_100KHZ", "6"); } if ( inputDial_6() == 9) { sendDcsBiosMessage("ARC_BCK_100KHZ", "7"); } if ( inputDial_6() == 10) { sendDcsBiosMessage("ARC_BCK_100KHZ", "8"); } if ( inputDial_6() == 11) { sendDcsBiosMessage("ARC_BCK_100KHZ", "9"); } if ( inputDial_6() == 12) { sendDcsBiosMessage("ARC_BCK_100KHZ", "10"); } if ( inputDial_6() == 13) { sendDcsBiosMessage("ARC_BCK_100KHZ", "11"); } if ( inputDial_6() == 14) { sendDcsBiosMessage("ARC_BCK_100KHZ", "12"); } if ( inputDial_6() == 15) { sendDcsBiosMessage("ARC_BCK_100KHZ", "13"); } if ( inputDial_6() == 16) { sendDcsBiosMessage("ARC_BCK_100KHZ", "14"); } if ( inputDial_6() == 17) { sendDcsBiosMessage("ARC_BCK_100KHZ", "15"); } if ( inputDial_6() == 18) { sendDcsBiosMessage("ARC_BCK_100KHZ", "16"); } if ( inputDial_6() == 19) { sendDcsBiosMessage("ARC_BCK_100KHZ", "17"); } if ( inputDial_6() == 20) { sendDcsBiosMessage("ARC_BCK_100KHZ", "18"); } if ( inputDial_6() == 1) { sendDcsBiosMessage("ARC_BCK_100KHZ", "19"); } if ( inputDial_6() == 2) { sendDcsBiosMessage("ARC_BCK_100KHZ", "20"); } } } If you still can't get it to work then it could be an issue with the ground wire for all the switches, although it sounds a bit strange since it worked via USB. In this code I added what I think is needed to get the timer function to work; /* 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 124 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ #include <timer.h> Timer tm; // Added int DCS_valueDial_1=0; // MAIN/1 0-1KHZ DIAL/ARK-9 TUNE int DCS_valueDial_2=0; // MAIN/1 10KHZ DIAL int DCS_valueDial_3=1; // MAIN/1 100KHZ DIAL int DCS_valueDial_4=0; // BACK/1 0-1KHZ DIAL/ARK-9 TUNE int DCS_valueDial_5=0; // BACK/1 10KHZ DIAL int DCS_valueDial_6=1; // BACK/1 100KHZ DIAL /* paste code snippets from the reference documentation here */ /*/////////////////////////////////* Switches and toggles*/ const byte arc9ModePins[4] = {6, 7, 8, 9}; DcsBios::SwitchMultiPos arc9Mode("ARC9_MODE", arc9ModePins, 4); const byte arc9MainBackupPins[2] = {3, 4}; DcsBios::SwitchMultiPos arc9MainBackup("ARC9_MAIN_BACKUP", arc9MainBackupPins, 2); const byte arc9TlfTlgPins[2] = {14,15}; DcsBios::SwitchMultiPos arc9TlfTlg("ARC9_TLF_TLG", arc9TlfTlgPins, 2); const byte arc9LoopPins[1] = {16}; //This appears to to have been a 3 position originally DcsBios::SwitchMultiPos arc9Loop("ARC_9_LOOP", arc9LoopPins, 1); ///////////////////////////////////////////// void onArc9MainTuneChange(unsigned int newValue) { DCS_valueDial_1 = newValue; } DcsBios::IntegerBuffer arc9MainTuneBuffer(0x2672, 0xffff, 0, onArc9MainTuneChange); void onArcMain10khzChange(unsigned int newValue) { DCS_valueDial_2 = newValue; } DcsBios::IntegerBuffer arcMain10khzBuffer(0x26a2, 0x00f0, 4, onArcMain10khzChange); void onArcMain100khzChange(unsigned int newValue) { DCS_valueDial_3 = newValue; } DcsBios::IntegerBuffer arcMain100khzBuffer(0x26a2, 0x000f, 0, onArcMain100khzChange); void onArc9BckTuneChange(unsigned int newValue) { DCS_valueDial_4 = newValue; } DcsBios::IntegerBuffer arc9BckTuneBuffer(0x2670, 0xffff, 0, onArc9BckTuneChange); void onArcBck10khzChange(unsigned int newValue) { DCS_valueDial_5 = newValue; } DcsBios::IntegerBuffer arcBck10khzBuffer(0x26a0, 0xf000, 12, onArcBck10khzChange); void onArcBck100khzChange(unsigned int newValue) { DCS_valueDial_6 = newValue; } DcsBios::IntegerBuffer arcBck100khzBuffer(0x26a0, 0x0f00, 8, onArcBck100khzChange); void setup() { DcsBios::setup(); //ARK-9 DIAL_1 MAIN INPUTS 0-9.5/ -10-+20 DDRC = B00000000; // set PIND (digital 37-30) as inputs PORTC = B11111111; // Sets (digital 37-30) with internal pull up //ARK-9 DIAL_2 MAIN inputs- 0-90 kHz Main DDRD = B00000000; // set PIND (digital 38+21-18) as inputs PORTD = B11111111; // Sets (digital 38+21-18) with internal pull up //ARK-9 DIAL_3 MAIN inputs- 100 kHz Main DDRA = B00000000; // set PINA (digital 29-22) as inputs PORTA = B11111111; // Sets (digital 29-22) with internal pull up //ARK-9 DIAL_4 BACK INPUTS 0-9.5/ -10-+20 DDRB = B00000000; // set PIND (digital 37-30) as inputs PORTB = B11111111; // Sets (digital 37-30) with internal pull up //ARK-9 DIAL_5 BACK inputs- 0-90 kHz Main DDRL = B00000000; // set PIND (digital 38+21-18) as inputs PORTL = B11111111; // Sets (digital 38+21-18) with internal pull up //ARK-9 DIAL_6 BACK inputs- 100 kHz Main DDRK = B00000000; // set PINA (digital 29-22) as inputs PORTK = B11111111; // Sets (digital 29-22) with internal pull up tm.startTimer(200, setDials); // Added } /////MAIN FREQUENCY TUNE DIAL; DIAL 1 /////////////////////// int inputDial_1() { int valueDial_1; if (PINC == B11111111) { valueDial_1 = 0; } if (PINC == B11111110) { valueDial_1 = 1; } if (PINC == B11101111) { valueDial_1 = 2; } if (PINC == B11101110) { valueDial_1 = 3; } if (PINC == B11111101) { valueDial_1 = 4; } if (PINC == B11111100) { valueDial_1 = 5; } if (PINC == B11101101) { valueDial_1 = 6; } if (PINC == B11101100) { valueDial_1 = 7; } if (PINC == B11110101) { valueDial_1 = 8; } if (PINC == B11110100) { valueDial_1 = 9; } if (PINC == B11100101) { valueDial_1 = 10; } if (PINC == B11100100) { valueDial_1 = 11; } if (PINC == B11111001) { valueDial_1 = 12; } if (PINC == B11111000) { valueDial_1 = 13; } if (PINC == B11101001) { valueDial_1 = 14; } if (PINC == B11101000) { valueDial_1 = 15; } if (PINC == B11110001) { valueDial_1 = 16; } if (PINC == B11110000) { valueDial_1 = 17; } if (PINC == B11100001) { valueDial_1 = 18; } if (PINC == B11100000) { valueDial_1 = 19; } return valueDial_1; } ///// END OF MAIN FREQUENCY TUNER DIAL_1/////////////////// /////MAIN 10KHZ ROTARY DIAL/////////////////////////////////////////////////// //ARK-9 DIAL_2 inputs- 0-90 kHz Main //DDRB = B00000000; // set PIND digital 53-50,10-13 as inputs //PORTB = B11111111; // Sets digital 53-50,10-13 with internal pull up //} int inputDial_2() { int valueDial_2; if (PIND == B11111111) { valueDial_2 = 0; } if (PIND == B11110111) { valueDial_2 = 1; } if (PIND == B11111011) { valueDial_2 = 2; } if (PIND == B11110011) { valueDial_2 = 3; } if (PIND == B01111010) { valueDial_2 = 4; } if (PIND == B01110010) { valueDial_2 = 5; } if (PIND == B01111001) { valueDial_2 = 6; } if (PIND == B01110001) { valueDial_2 = 7; } if (PIND == B01111000) { valueDial_2 = 8; } if (PIND == B01110000) { valueDial_2 = 9; } return valueDial_2; } ////222222//END OF MAIN 10KHZ ROTARY DIAL_2//////////////// //33333///MAIN 100KHZ DIAL_3 /////////////////////// int inputDial_3() { int valueDial_3; if (PINA == B11111111) { valueDial_3 = 1; } if (PINA == B11110111) { valueDial_3 = 2; } if (PINA == B11111110) { valueDial_3 = 3; } if (PINA == B11110110) { valueDial_3 = 4; } if (PINA == B11111010) { valueDial_3 = 5; } if (PINA == B11110010) { valueDial_3 = 6; } if (PINA == B11111100) { valueDial_3 = 7; } if (PINA == B11110100) { valueDial_3 = 8; } if (PINA == B11111000) { valueDial_3 = 9; } if (PINA == B11110000) { valueDial_3 = 10; } if (PINA == B11101111) { valueDial_3 = 11; } if (PINA == B11100111) { valueDial_3 = 12; } if (PINA == B11101110) { valueDial_3 = 13; } if (PINA == B11100110) { valueDial_3 = 14; } if (PINA == B11101010) { valueDial_3 = 15; } if (PINA == B11100010) { valueDial_3 = 16; } if (PINA == B11101100) { valueDial_3 = 17; } if (PINA == B11100100) { valueDial_3 = 18; } if (PINA == B11100100) { valueDial_3 = 19; } if (PINA == B11100100) { valueDial_3 = 20; } return valueDial_3; } ////333333333////END OF MAIN 100KHZ DIAL 3 /////BACK FREQUENCY TUNE DIAL; DIAL 1 /////////////////////// int inputDial_4() { int valueDial_4; if (PINB == B11111111) { valueDial_4 = 0; } if (PINB == B11111110) { valueDial_4 = 1; } if (PINB == B11101111) { valueDial_4 = 2; } if (PINB == B11101110) { valueDial_4 = 3; } if (PINB == B11111101) { valueDial_4 = 4; } if (PINB == B11111100) { valueDial_4 = 5; } if (PINB == B11101101) { valueDial_4 = 6; } if (PINB == B11101100) { valueDial_4 = 7; } if (PINB == B11110101) { valueDial_4 = 8; } if (PINB == B11110100) { valueDial_4 = 9; } if (PINB == B11100101) { valueDial_4 = 10; } if (PINB == B11100100) { valueDial_4 = 11; } if (PINB == B11111001) { valueDial_4 = 12; } if (PINB == B11111000) { valueDial_4 = 13; } if (PINB == B11101001) { valueDial_4 = 14; } if (PINB == B11101000) { valueDial_4 = 15; } if (PINB == B11110001) { valueDial_4 = 16; } if (PINB == B11110000) { valueDial_4 = 17; } if (PINB == B11100001) { valueDial_4 = 18; } if (PINB == B11100000) { valueDial_4 = 19; } return valueDial_4; } ///// END OF BACK FREQUENCY TUNER DIAL_1/////////////////// /////BACK 10KHZ ROTARY DIAL 5/////////////////////////////////////////////////// //ARK-9 DIAL_5 inputs- 0-90 kHz BACK int inputDial_5() { int valueDial_5; if (PINL == B11111111) { valueDial_5 = 0; } if (PINL == B11110111) { valueDial_5 = 1; } if (PINL == B11111011) { valueDial_5 = 2; } if (PINL == B11110011) { valueDial_5 = 3; } if (PINL == B11101010) { valueDial_5 = 4; } if (PINL == B11100010) { valueDial_5 = 5; } if (PINL == B11101001) { valueDial_5 = 6; } if (PINL == B11100001) { valueDial_5 = 7; } if (PINL == B11101000) { valueDial_5 = 8; } if (PINL == B11100000) { valueDial_5 = 9; } return valueDial_5; } ////555555//END OF BACK 10KHZ ROTARY DIAL_5//////////////// //666666///BACK 100KHZ DIAL_6 /////////////////////// int inputDial_6() { int valueDial_6; if (PINK == B11111111) { valueDial_6 = 1; } if (PINK == B11110111) { valueDial_6 = 2; } if (PINK == B11111110) { valueDial_6 = 3; } if (PINK == B11110110) { valueDial_6 = 4; } if (PINK == B11111010) { valueDial_6 = 5; } if (PINK == B11110010) { valueDial_6 = 6; } if (PINK == B11111100) { valueDial_6 = 7; } if (PINK == B11110100) { valueDial_6 = 8; } if (PINK == B11111000) { valueDial_6 = 9; } if (PINK == B11110000) { valueDial_6 = 10; } if (PINK == B11101111) { valueDial_6 = 11; } if (PINK == B11100111) { valueDial_6 = 12; } if (PINK == B11101110) { valueDial_6 = 13; } if (PINK == B11100110) { valueDial_6 = 14; } if (PINK == B11101010) { valueDial_6 = 15; } if (PINK == B11100010) { valueDial_6 = 16; } if (PINK == B11101100) { valueDial_6 = 17; } if (PINK == B11100100) { valueDial_6 = 18; } if (PINK == B11100100) { valueDial_6 = 19; } if (PINK == B11100100) { valueDial_6 = 20; } return valueDial_6; } ////666666////END OF BACK 100KHZ DIAL 6 void loop() { DcsBios::loop(); tm.runTimers(); // Added } //Changed setup void setDials(int timer){ // Check and adjust 1st dial if (DCS_valueDial_1 != inputDial_1()) { if ( inputDial_1() == 0) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "0"); } if ( inputDial_1() == 1) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "3200"); } if ( inputDial_1() == 2) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "6400"); } if ( inputDial_1() == 3) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "9600"); } if ( inputDial_1() == 4) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "12800"); } if ( inputDial_1() == 5) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "16000"); } if ( inputDial_1() == 6) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "19200"); } if ( inputDial_1() == 7) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "22400"); } if ( inputDial_1() == 8) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "25600"); } if ( inputDial_1() == 9) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "28800"); } if ( inputDial_1() == 10) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "32000"); } if ( inputDial_1() == 11) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "35200"); } if ( inputDial_1() == 12) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "38400"); } if ( inputDial_1() == 13) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "41600"); } if ( inputDial_1() == 14) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "44800"); } if ( inputDial_1() == 15) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "48000"); } if ( inputDial_1() == 16) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "51200"); } if ( inputDial_1() == 17) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "54400"); } if ( inputDial_1() == 18) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "57600"); } if ( inputDial_1() == 19) { sendDcsBiosMessage("ARC9_MAIN_TUNE", "60800"); } } // 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"); } } // Check and adjust 3RD dial if (DCS_valueDial_3 != inputDial_3()) { if ( inputDial_3() == 3) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "1"); } if ( inputDial_3() == 4) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "2"); } if ( inputDial_3() == 5) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "3"); } if ( inputDial_3() == 6) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "4"); } if ( inputDial_3() == 7) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "5"); } if ( inputDial_3() == 8) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "6"); } if ( inputDial_3() == 9) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "7"); } if ( inputDial_3() == 10) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "8"); } if ( inputDial_3() == 11) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "9"); } if ( inputDial_3() == 12) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "10"); } if ( inputDial_3() == 13) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "11"); } if ( inputDial_3() == 14) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "12"); } if ( inputDial_3() == 15) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "13"); } if ( inputDial_3() == 16) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "14"); } if ( inputDial_3() == 17) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "15"); } if ( inputDial_3() == 18) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "16"); } if ( inputDial_3() == 19) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "17"); } if ( inputDial_3() == 20) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "18"); } if ( inputDial_3() == 1) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "19"); } if ( inputDial_3() == 2) { sendDcsBiosMessage("ARC_MAIN_100KHZ", "20"); } } // Check and adjust 4TH dial if (DCS_valueDial_4 != inputDial_4()) { if ( inputDial_4() == 0) { sendDcsBiosMessage("ARC9_BCK_TUNE", "0"); } if ( inputDial_4() == 1) { sendDcsBiosMessage("ARC9_BCK_TUNE", "3200"); } if ( inputDial_4() == 2) { sendDcsBiosMessage("ARC9_BCK_TUNE", "6400"); } if ( inputDial_4() == 3) { sendDcsBiosMessage("ARC9_BCK_TUNE", "9600"); } if ( inputDial_4() == 4) { sendDcsBiosMessage("ARC9_BCK_TUNE", "12800"); } if ( inputDial_4() == 5) { sendDcsBiosMessage("ARC9_BCK_TUNE", "16000"); } if ( inputDial_4() == 6) { sendDcsBiosMessage("ARC9_BCK_TUNE", "19200"); } if ( inputDial_4() == 7) { sendDcsBiosMessage("ARC9_BCK_TUNE", "22400"); } if ( inputDial_4() == 8) { sendDcsBiosMessage("ARC9_BCK_TUNE", "25600"); } if ( inputDial_4() == 9) { sendDcsBiosMessage("ARC9_BCK_TUNE", "28800"); } if ( inputDial_4() == 10) { sendDcsBiosMessage("ARC9_BCK_TUNE", "32000"); } if ( inputDial_4() == 11) { sendDcsBiosMessage("ARC9_BCK_TUNE", "35200"); } if ( inputDial_4() == 12) { sendDcsBiosMessage("ARC9_BCK_TUNE", "38400"); } if ( inputDial_4() == 13) { sendDcsBiosMessage("ARC9_BCK_TUNE", "41600"); } if ( inputDial_4() == 14) { sendDcsBiosMessage("ARC9_BCK_TUNE", "44800"); } if ( inputDial_4() == 15) { sendDcsBiosMessage("ARC9_BCK_TUNE", "48000"); } if ( inputDial_4() == 16) { sendDcsBiosMessage("ARC9_BCK_TUNE", "51200"); } if ( inputDial_4() == 17) { sendDcsBiosMessage("ARC9_BCK_TUNE", "54400"); } if ( inputDial_4() == 18) { sendDcsBiosMessage("ARC9_BCK_TUNE", "57600"); } if ( inputDial_4() == 19) { sendDcsBiosMessage("ARC9_BCK_TUNE", "60800"); } } // Check and adjust 5TH dial if (DCS_valueDial_5 != inputDial_5()) { if ( inputDial_5() == 0) { sendDcsBiosMessage("ARC_BCK_10KHZ", "0"); } if ( inputDial_5() == 1) { sendDcsBiosMessage("ARC_BCK_10KHZ", "1"); } if ( inputDial_5() == 2) { sendDcsBiosMessage("ARC_BCK_10KHZ", "2"); } if ( inputDial_5() == 3) { sendDcsBiosMessage("ARC_BCK_10KHZ", "3"); } if ( inputDial_5() == 4) { sendDcsBiosMessage("ARC_BCK_10KHZ", "4"); } if ( inputDial_5() == 5) { sendDcsBiosMessage("ARC_BCK_10KHZ", "5"); } if ( inputDial_5() == 6) { sendDcsBiosMessage("ARC_BCK_10KHZ", "6"); } if ( inputDial_5() == 7) { sendDcsBiosMessage("ARC_BCK_10KHZ", "7"); } if ( inputDial_5() == 8) { sendDcsBiosMessage("ARC_BCK_10KHZ", "8"); } if ( inputDial_5() == 9) { sendDcsBiosMessage("ARC_BCK_10KHZ", "9"); } } // Check and adjust 6TH dial if (DCS_valueDial_6 != inputDial_6()) { if ( inputDial_6() == 3) { sendDcsBiosMessage("ARC_BCK_100KHZ", "1"); } if ( inputDial_6() == 4) { sendDcsBiosMessage("ARC_BCK_100KHZ", "2"); } if ( inputDial_6() == 5) { sendDcsBiosMessage("ARC_BCK_100KHZ", "3"); } if ( inputDial_6() == 6) { sendDcsBiosMessage("ARC_BCK_100KHZ", "4"); } if ( inputDial_6() == 7) { sendDcsBiosMessage("ARC_BCK_100KHZ", "5"); } if ( inputDial_6() == 8) { sendDcsBiosMessage("ARC_BCK_100KHZ", "6"); } if ( inputDial_6() == 9) { sendDcsBiosMessage("ARC_BCK_100KHZ", "7"); } if ( inputDial_6() == 10) { sendDcsBiosMessage("ARC_BCK_100KHZ", "8"); } if ( inputDial_6() == 11) { sendDcsBiosMessage("ARC_BCK_100KHZ", "9"); } if ( inputDial_6() == 12) { sendDcsBiosMessage("ARC_BCK_100KHZ", "10"); } if ( inputDial_6() == 13) { sendDcsBiosMessage("ARC_BCK_100KHZ", "11"); } if ( inputDial_6() == 14) { sendDcsBiosMessage("ARC_BCK_100KHZ", "12"); } if ( inputDial_6() == 15) { sendDcsBiosMessage("ARC_BCK_100KHZ", "13"); } if ( inputDial_6() == 16) { sendDcsBiosMessage("ARC_BCK_100KHZ", "14"); } if ( inputDial_6() == 17) { sendDcsBiosMessage("ARC_BCK_100KHZ", "15"); } if ( inputDial_6() == 18) { sendDcsBiosMessage("ARC_BCK_100KHZ", "16"); } if ( inputDial_6() == 19) { sendDcsBiosMessage("ARC_BCK_100KHZ", "17"); } if ( inputDial_6() == 20) { sendDcsBiosMessage("ARC_BCK_100KHZ", "18"); } if ( inputDial_6() == 1) { sendDcsBiosMessage("ARC_BCK_100KHZ", "19"); } if ( inputDial_6() == 2) { sendDcsBiosMessage("ARC_BCK_100KHZ", "20"); } } } Cheers Hans
  7. Hi Mole, What does your communications window look like without running DCS. It should look like this I.e. you should be able to see commands from the slave board for both dials and switches Cheers Hans
  8. Excellent work work molevitch :thumbup: Glad you got it running again sir Cheers Hans
  9. Hi molevitch, Is the MAX487 chip on your Mega slave hot. I seem to recall having a similar issue and exchanged the chip. Didn't solve the problem. Then a changed to a third one which worked. IIRCC then the ones I had that didn't work were quite warm/hot. Cheers Hans
  10. Hi molevitch, How does your communication look when DCS is not running but your RS-485 is? I had an issue a few years back when running potentiometers. They kept updating which gave a lot of communication. I had seen same when I ran Helios. The communication was simply flooded with information. I solved this in the by adding a deadband around the current value. If the value from the potentiometer was within the deadband then no update was sent; https://forums.eagle.ru/showpost.php?p=3020643&postcount=127 I think Ian added something more clever but I am still running this. Cheers Hans
  11. Outstanding Mole. That is great news. Good job sir Cheers Hans
  12. Added a little extra information/suggestions in post #2, plus added a note in the beginning of post #1 . Cheers Hans
  13. Looks very promissing. Great to have you back sir:thumbup: Only small modifications to the IFF. GSS Rain reported some issues with one of the toggle switches and quick found the solution; https://forums.eagle.ru/showthread.php?t=189774 The because I found the same kind of 5*7 segments you use (HCMS-2963) I removed the spacing between the text blocks; local function getCMSPDisplayLines(dev0) local cmsp = BIOS.util.parse_indication(7) if not cmsp then local emptyline = string.format("%16s", "") -- 19 spaces, changed to 16 spaces and space removed in "" return emptyline, emptyline else local tu = cmsp["txt_UP"] local line1 = string.format("%-4s", tu:sub(0, 4)).. ""..string.format("%-4s", tu:sub(5, 8)).. ""..string.format("%-4s", tu:sub(9, 12)).. ""..string.format("%-4s", tu:sub(13, 16)) local line2 = string.format("%-4s", cmsp["txt_DOWN1"]).. ""..string.format("%-4s", cmsp["txt_DOWN2"]).. ""..string.format("%-4s", cmsp["txt_DOWN3"]).. ""..string.format("%-4s", cmsp["txt_DOWN4"]) return line1, line2 end end I think I may have gotten them from same supplier, very good price and very easy to work with. Sent a few to a good friend in Canada because he was missing them for his CMSP. Nice is that the solution WarHog may have mentioned to me that you solved the issue that they didn't write instantly but rather you could see timing when writing full line? Just did I quick test replacing my original LedDisplay library with your but couldn't get that to work. I'll look at it another day :-) Cheers Hans
  14. Welcome back @Ian. You have been sorely missed. What is the big difference between the pre-release DCS-BIOS 0.8.0 and older versions? I still running v0.7.0 but in a modified version. Are the displays in your cockpit setup HCMS-2963's? Good job on your job situation and once again welcome back. Cheers Hans
  15. That looks like a very good start indeed sir. Nicely done. :thumbup: Cheers Hans
  16. Hi patogn20, Which module is it you are working on? The easiest way to deal with this is to mechanical turn you toggle switch 180º. Then you do not need to change any of the DCS-BIOS code. Cheers Hans Sorry but which module are you working on? Cheers Hans
  17. Hi Mark, I have no idea. I haven't tried to run DCS-BIOS using this method. Cheers Hans
  18. @Sickdog, I noticed something similar when running the magnetic held switches at 24VDC. The bat got qiute hot. Since I was able to use 12VDC then that issue dissapeared. I know this will solve it for you as yours won't energize at 12VDC. Cheers Hans
  19. @BULLIT83, what happens if you plug in the connector (in right sequence) but at the other end of the board? My guess is that one end is input to the display and the other is output to another display. PS. Which one have you bought? Cheers Hans
  20. DCS-BIOS is natively set for internal pull. [ian] already designed the system so you didn't need to apply external resistors for inputs. When you load your first sketch you can measure it with a voltmeter between ground and the input you have designated. It will read 5VDC. I don't think it's mentioned at least in the original documentation. I seem to recall Ian mentioned it in a post but can't remember where. You can kinda see from the example in the documentation as the push button is connected between an input and GND. Hope it answers your question. Cheers Hans
  21. Depends on whether you already have the Ledcontrol library installed. Easiest way to check that is just to include; #include <LedControl.h> If the compiling will let you know if the library is missing. I used these for my AN/ARC-164 but they do require a made PCB for them; https://www.ebay.com/itm/1-Lot-of-25-Pieces-Avago-HDSP-U503-LED/291589746309?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m1438.l2649 Cheers Hans
  22. No that not entirely correct I think. How many digits have you setup and are you able to light them up with one of the Ledcontrol examples supplied when you have included the Ledcontrol library? If no then try that at first to make sure your wiring and setup works before starting with DCS-BIOS. It will be easier for you later on to fault trace if it doesn't work. If yes then proceed with your basic DCS-BIOS sketch from the example list; /* /* 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 */ void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Then you start by including the Ledcontrol library and defining it in the setup; /* 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 <LedControl.h> /* pin 7 is connected to the DataIn pin 6 is connected to the CLK pin 5 is connected to LOAD We have only a single MAX72XX. */ LedControl lc=LedControl(7,6,5,1); /* paste code snippets from the reference documentation here */ 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 } void loop() { DcsBios::loop(); } This should compile. Then you can include a small test of the display when you power up your Arduino; /* 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 <LedControl.h> /* pin 7 is connected to the DataIn pin 6 is connected to the CLK pin 5 is connected to LOAD We have only a single MAX72XX. */ LedControl lc=LedControl(7,6,5,1); /* paste code snippets from the reference documentation here */ 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); } void loop() { DcsBios::loop(); } Above assumes you have 6 digits, if not then please adjust. Then you include you code for the ARC-159; /* 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 <LedControl.h> /* pin 7 is connected to the DataIn pin 6 is connected to the CLK pin 5 is connected to LOAD We have only a single MAX72XX. */ LedControl lc=LedControl(7,6,5,1); /* paste code snippets from the reference documentation here */ //PILOT ARC-159 Frequency void onPltUhfStringFreqChange(char* newValue) { lc.setChar(0,0,newValue[0],false); lc.setChar(0,1,newValue[1],false); lc.setChar(0,2,newValue[2],true); //true=this is the full stop after digit no 3 lc.setChar(0,3,newValue[4],false); lc.setChar(0,4,newValue[5],false); lc.setChar(0,5,newValue[6],false); } DcsBios::StringBuffer<7> pltUhfStringFreqBuffer(0x1248, onPltUhfStringFreqChange); 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); } void loop() { DcsBios::loop(); } But as stated on top start with getting the digits to light up without DCS-BIOS. Please also note that above has been done from my AN/ARC-164 sketch for the A-10C so there may be variations since the it's not the same module as the one you are using. Cheers Hans
  23. Well that's bit odd since all the mag switches I have, including one on an F-16 harness and on on a Huey panel, is marked with 28VDC not AC. I have been running my 7 mag switches in the A-10C pit for over 2 years on 12VDC over MOSFET's and never had any issues; Cheers Hans
  24. Very good sir. What was the issue and how did you solve it? Cheers Hans
×
×
  • Create New...