Jump to content

olive47

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by olive47


  1. /*
      Tell DCS-BIOS to use a serial connection and use interrupt-driven
      communication. The main program will be interrupted to prioritize
      processing incoming data.
      
     
     TACAN with 7 seg Display and TM1637
     This sketch sets the Pro Mini as a Slave to the RS-485 Bus for the right console.
     NOTE:  #defines are to be placed before the #includes
     */

    #define DCSBIOS_IRQ_SERIAL
    #include "DcsBios.h"
    #include <TM1637TinyDisplay.h>
    #include <LedControl.h>

    String TACAN = ""; // Declare global new string variable
    char Digit0 = ""; // Declare global new character variable
    char Digit1 = "";//  Declare global new character variable
    char Digit2 = "";//  Declare global new character variable
    char Digit3 = "";//  Declare global new character variable
    int TACAN_power = 0;

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


    //FIRST - 4 DIGIT 7 SEGMENT DISPLAY-  tacan
    // Module connection pins (Digital Pins)
    #define CLK 2
    #define DIO 3
    TM1637TinyDisplay display (CLK, DIO); //set up the 4-Digit Display


    DcsBios::Switch2Pos tacanTestBtn("TACAN_TEST_BTN", 23);
    DcsBios::LED tacanTest(0x10da, 0x0400, 13);
    DcsBios::PotentiometerEWMA<5, 128, 5> tacanVol("TACAN_VOL", A0);
    const byte tacanModePins[5] = {4, 5, 6, 7, 8};
    DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5);
    DcsBios::Switch2Pos tacanXy("TACAN_XY", 22);
    DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", 9, 10);
    DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", 11, 12);
    DcsBios::Switch3Pos a102HmcsPw("A102_HMCS_PW", 52, 53);

    void onTacan10Change(unsigned int newValue) {
      display.showNumber(newValue, true,2, 0);     
    }
    DcsBios::IntegerBuffer tacan10Buffer(0x1158, 0x0f00, 8, onTacan10Change);


    void onTacan1Change(unsigned int newValue) {
     display.showNumber(newValue, false,1, 2); 
    }
    DcsBios::IntegerBuffer tacan1Buffer(0x1158, 0xf000, 12, onTacan1Change);

    void onTacanXyChange(unsigned int newValue) {
     display.showString (newValue ,1, 3); // affiche la partie chaîne en seulement le 4ème chiffre
    }
    DcsBios::IntegerBuffer tacanXyBuffer(0x1168, 0x000f, 1, onTacanXyChange);


    // Canal TACAN
    void onTacanChannelChange (char * newValue) {
    Digit0 = TACAN.charAt (0); // récupère une valeur de caractère individuelle à cet index spécifique dans la chaîne
    Digit1 = TACAN.charAt (1);
    Digit2 = TACAN.charAt (2);
    Digit3 = TACAN.charAt (3);
    if (TACAN_power == 0)  
    display.showString(newValue, 4, 0);
    }
    DcsBios :: StringBuffer <4> tacanChannelBuffer (0x1162, onTacanChannelChange);


    void onTacanModeChange(unsigned int newValue) {
    if (newValue == 0){
    display.setBrightness(0, false);}
    else {display.setBrightness(15, true);}
    }
    DcsBios::IntegerBuffer tacanModeBuffer(0x1168, 0x000e, 1, onTacanModeChange);
    DcsBios::ActionButton tacanXyToggle("TACAN_XY", "TOGGLE", 22);

    void setup(){ 
    display.clear();
    DcsBios::setup();
    }
    void loop() 
    {
    DcsBios::loop();
    }
       

     

  2. ILS

    /*
      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 "TM1637TinyDisplay6.h"
    #include "DcsBios.h"
    #include <LedControl.h>

    //FIRST - 6 DIGIT 7 SEGMENT DISPLAY-Ils
    // Module connection pins (Digital Pins)
    #define CLK 2
    #define DIO 3
    TM1637TinyDisplay6 Ils(CLK, DIO); // 6-Digit Display Class Ils

    DcsBios::PotentiometerEWMA<5, 128, 5> ilsVol("ILS_VOL", A0);
    DcsBios::Switch2Pos ilsPwr("ILS_PWR", 4);
    DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 6, 7);
    DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 11, 12);
    DcsBios::Switch3Pos a102HmcsPw("A102_HMCS_PW", 8, 9);
    //ILS
    void onIlsMhzChange(char* newValue) {
    Ils.showString(newValue, 3, 0);
    }
    DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange);
    void onIlsKhzChange(char* newValue) {
      
    Ils.showString(newValue, 2, 4);
    }
    DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange);


    // Canal Ils
    void onIlsFrequencySChange(char* newValue) {

      
    Ils.showString (newValue, 0, 6);
    }
    DcsBios::StringBuffer<6> ilsFrequencySBuffer(0x12d8, onIlsFrequencySChange);


    void onIlsPwrChange(unsigned int newValue) {
    if (newValue > 0){
    Ils.setBrightness(15, true);
    }
    else {Ils.setBrightness(15, false);
    }
    }
    DcsBios::IntegerBuffer ilsPwrBuffer(0x1168, 0x0010, 4, onIlsPwrChange);


    void setup()
    {
    DcsBios::setup();
    Ils.clear();
    }
    void loop()
    {
    DcsBios::loop();
    }

  3. Après avoir rèsolu le tacan, je m attaque a l ILS. TM1637 6 DIGITS . MON tm1637 AFFICHE 801.53 ALORS QUE SUR dcs L I LS AFFICHE 108.35. MERCI . #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <TM1637TinyDisplay.h> #include <LedControl.h> String Ils = ""; // Declare global new string variable char Digit0 = ""; // Declare global new character variable char Digit1 = "";// Declare global new character variable char Digit2 = "";// Declare global new character variable char Digit3 = "";// 0 char Digit4 = "";// Declare global new character variable char Digit5 = "";// Declare global new character variable int Ils_power = 1; //FIRST - 6 DIGIT 7 SEGMENT DISPLAY-Ils // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637TinyDisplay display (CLK, DIO); //set up the 6-Digit Display DcsBios::PotentiometerEWMA<5, 128, 5> ilsVol("ILS_VOL", A0); DcsBios::Switch2Pos ilsPwr("ILS_PWR", 4); DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 5, 6); DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 7, 8); //ILS // DCS-Bios Code // Appel DCS-Bios Khz avec A10C.lua void onIlsMhzChange(char* newValue) { display.showString(newValue, 3, 0); } DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange); void onIlsKhzChange(char* newValue){ display.showString(newValue, 2, 4); } DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange); // Canal Ils void onIlsFrequencySChange(char* newValue) { display.showString(newValue, 0, 6); } DcsBios::StringBuffer<6> ilsFrequencySBuffer(0x12d8, onIlsFrequencySChange); void onIlsPwrChange(unsigned int newValue) { if (newValue == 0) { display.setBrightness(0, false ); } else { display.setBrightness(15, true); } } DcsBios::IntegerBuffer ilsPwrBuffer(0x1168, 0x0010, 4, onIlsPwrChange); void setup() { display.clear(); DcsBios::setup(); } void loop(){ DcsBios::loop(); }
  4. Après avoir rèsolu le tacan, je m attaque a l ILS. TM1637 6 DIGITS . MON tm1637 AFFICHE 801.53 ALORS QUE SUR dcs L I LS AFFICHE 108.35. MERCI . #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <TM1637TinyDisplay.h> #include <LedControl.h> String Ils = ""; // Declare global new string variable char Digit0 = ""; // Declare global new character variable char Digit1 = "";// Declare global new character variable char Digit2 = "";// Declare global new character variable char Digit3 = "";// 0 char Digit4 = "";// Declare global new character variable char Digit5 = "";// Declare global new character variable int Ils_power = 1; //FIRST - 6 DIGIT 7 SEGMENT DISPLAY-Ils // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637TinyDisplay display (CLK, DIO); //set up the 6-Digit Display DcsBios::PotentiometerEWMA<5, 128, 5> ilsVol("ILS_VOL", A0); DcsBios::Switch2Pos ilsPwr("ILS_PWR", 4); DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 5, 6); DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 7, 8); //ILS // DCS-Bios Code // Appel DCS-Bios Khz avec A10C.lua void onIlsMhzChange(char* newValue) { display.showString(newValue, 3, 0); } DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange); void onIlsKhzChange(char* newValue){ display.showString(newValue, 2, 4); } DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange); // Canal Ils void onIlsFrequencySChange(char* newValue) { display.showString(newValue, 0, 6); } DcsBios::StringBuffer<6> ilsFrequencySBuffer(0x12d8, onIlsFrequencySChange); void onIlsPwrChange(unsigned int newValue) { if (newValue == 0) { display.setBrightness(0, false ); } else { display.setBrightness(15, true); } } DcsBios::IntegerBuffer ilsPwrBuffer(0x1168, 0x0010, 4, onIlsPwrChange); void setup() { display.clear(); DcsBios::setup(); } void loop(){ DcsBios::loop(); }
  5. RESOLUT /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. TACAN with 7 seg Display and TM1637 This sketch sets the Pro Mini as a Slave to the RS-485 Bus for the right console. NOTE: #defines are to be placed before the #includes */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <TM1637TinyDisplay.h> #include <LedControl.h> String TACAN = ""; // Declare global new string variable char Digit0 = ""; // Declare global new character variable char Digit1 = "";// Declare global new character variable char Digit2 = "";// Declare global new character variable char Digit3 = "";// Declare global new character variable int TACAN_power = 0; int Tacan_ingame1; // hold value from DCS for ones int Tacan_ingame10; // hold value from DCS for tens int Tacan_ingame100; // hold value from DCS for hundreds //FIRST - 4 DIGIT 7 SEGMENT DISPLAY- tacan // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637TinyDisplay display (CLK, DIO); //set up the 4-Digit Display DcsBios::Switch2Pos tacanTestBtn("TACAN_TEST_BTN", 23); DcsBios::LED tacanTest(0x10da, 0x0400, 13); DcsBios::PotentiometerEWMA<5, 128, 5> tacanVol("TACAN_VOL", A0); const byte tacanModePins[5] = {4, 5, 6, 7, 8}; DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5); DcsBios::Switch2Pos tacanXy("TACAN_XY", 22); DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", 9, 10); DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", 11, 12); void onTacan10Change(unsigned int newValue) { display.showNumber(newValue, true,2, 0); } DcsBios::IntegerBuffer tacan10Buffer(0x1158, 0x0f00, 8, onTacan10Change); void onTacan1Change(unsigned int newValue) { display.showNumber(newValue, false,1, 2); } DcsBios::IntegerBuffer tacan1Buffer(0x1158, 0xf000, 12, onTacan1Change); // Canal TACAN void onTacanChannelChange (char * newValue) { Digit0 = TACAN.charAt (0); // récupère une valeur de caractère individuelle à cet index spécifique dans la chaîne Digit1 = TACAN.charAt (1); Digit2 = TACAN.charAt (2); Digit3 = TACAN.charAt (3); if (TACAN_power == 0) display.showString(newValue, 4, 0); } DcsBios :: StringBuffer <4> tacanChannelBuffer (0x1162, onTacanChannelChange); void onTacanModeChange(unsigned int newValue) { if (newValue == 0){ display.setBrightness(0, false);} else {display.setBrightness(15, true);} } DcsBios::IntegerBuffer tacanModeBuffer(0x1168, 0x000e, 1, onTacanModeChange); DcsBios::ActionButton tacanXyToggle("TACAN_XY", "TOGGLE", 22); void setup(){ display.clear(); DcsBios::setup(); } void loop() { DcsBios::loop(); }
  6. Mon problèm B335E7BB-90CC-42B1-8508-60A70794B603.MOV
  7. you are a champion in advance thanks to you. the 2 and 3 digits work. except that on the 2nd digit when I pass the 0 the first must display 1. and it remains at 0 a new code void setup() { display.setBrightness(7); DcsBios::setup(); } void onTacan10Change(unsigned int newValue) { display.showNumber(newValue,false,1,1);// set 1's place to second 2digit } DcsBios::IntegerBuffer tacan10Buffer(0x1158, 0x0f00, 8, onTacan10Change); void onTacan1Change(unsigned int newValue) { display.showNumber(newValue,false,1,2);// set 10's place to 0th (first) digit } DcsBios::IntegerBuffer tacan1Buffer(0x1158, 0xff00, 12, onTacan1Change); void onTacanXyChange(unsigned int newValue) { display.showString (newValue, 1, 3); // affiche la partie chaîne en seulement le 4ème chiffre } DcsBios::IntegerBuffer tacanXyBuffer(0x1168, 0x000f, 0, onTacanXyChange); // TACAN Channel void onTacanChannelChange(char* newValue) { TACAN = newValue; // Store incoming char string to a new string variable name Digit0 = TACAN.charAt(0); // grab individual char value at that specific index in the string Digit1 = TACAN.charAt(1); Digit2 = TACAN.charAt(2); Digit3 = TACAN.charAt(3); if (TACAN_power == 0) { } DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange); } void loop() { DcsBios::loop(); }
  8. I need the help of someone who knows how to write code. For my TACAN I'm using mega2560 and TM1637 4digits . it does not work #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <TM1637TinyDisplay.h> #include <LedControl.h> //FIRST - 4 DIGIT 7 SEGMENT DISPLAY- tacan // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637TinyDisplay display(CLK, DIO); //set up the 4-Digit Display DcsBios::Switch2Pos tacanTestBtn("TACAN_TEST_BTN", 23); DcsBios::LED tacanTest(0x10da, 0x0400, 13); DcsBios::PotentiometerEWMA<5, 128, 5> tacanVol("TACAN_VOL", A0); const byte tacanModePins[5] = {4, 5, 6, 7, 8}; DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5); DcsBios::Switch2Pos tacanXy("TACAN_XY", 22); DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", 9, 10); DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", 11, 12); void setup() { display.setBrightness(7); DcsBios::setup(); } void onTacan10Change(unsigned int newValue) { display.showNumberDec(newValue); } DcsBios::IntegerBuffer tacan10Buffer(0x1158, 0x0f00, 12, onTacan10Change); void onTacan1Change(unsigned int newValue) { display.showNumberDec(newValue); } DcsBios::IntegerBuffer tacan1Buffer(0x1158, 0xf000, 9, onTacan1Change); void onTacanChannelChange (char * newValue){ display.showNumberDec(newValue); } DcsBios :: StringBuffer <4> tacanChannelBuffer (0x1162, onTacanChannelChange); void loop() { DcsBios::loop(); }
  9. help. mega 2560 card. TM1637 4 DIGITS. My code does not work #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <TM1637TinyDisplay.h> #include <LedControl.h> char Digit0 = ""; // Déclarer une nouvelle variable de caractère globale char Digit1 = ""; char Digit2 = ""; char Digit3 = ""; int TACAN_power = 0; //FIRST - 4 DIGIT 7 SEGMENT DISPLAY- tacan // Module connection pins (Digital Pins) #define CLK 2 #define DIO 3 TM1637TinyDisplay display(CLK, DIO); //set up the 4-Digit Display DcsBios::Switch2Pos tacanTestBtn("TACAN_TEST_BTN", 23); DcsBios::LED tacanTest(0x10da, 0x0400, 13); DcsBios::PotentiometerEWMA<5, 128, 5> tacanVol("TACAN_VOL", A0); const byte tacanModePins[5] = {4, 5, 6, 7, 8}; DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5); DcsBios::Switch2Pos tacanXy("TACAN_XY", 22); DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", 9, 10); DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", 11, 12); void setup() { display.setBrightness(7); DcsBios::setup(); } void onTacan10Change(unsigned int newValue) { display.showNumberDec(newValue); } DcsBios::IntegerBuffer tacan10Buffer(0x1158, 0x0f00, 12, onTacan10Change); void onTacan1Change(unsigned int newValue) { display.showNumberDec(newValue); } DcsBios::IntegerBuffer tacan1Buffer(0x1158, 0xf000, 9, onTacan1Change); void onTacanChannelChange (char * newValue){ display.showNumberDec(newValue); } DcsBios :: StringBuffer <4> tacanChannelBuffer (0x1162, onTacanChannelChange); void loop() { DcsBios::loop();
  10. Salut a vous.... quelqu un ce serait penché sur le tacan du A10??? j ai un 7 segments 4 digit TM1637 avec une mega 2560 merci d avance si quelqu un a un code a partager , car je pedale dans la semoule .
  11. Bonjour, j aurais voulu savoir si quelqu un c etait penché sur le code du tacan de l A10C carte arduino afficheur 7 segments TM 1637 pour dcs bios . Merci
×
×
  • Create New...