Results 1 to 10 of 10
  1. #1
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Simconnect extractions Expert

    Good evening,
    I have been playing with the simconnect extractions in the expert section and am trying to get the vertical speed setting to read out on a maxim7219 7 segment display. I have had a look around but cant seem to fond any info on this. I have coded it like similar to my radio comm/nav radio but my thinking was it would come under void OTHER & the case would be #G.
    Is it likely to be a code problem or have I done something else wrong.
    Thanks in advance
    Marc

    Code:
    #include "LedControl.h"  
    #include "math.h" 
         
                                   // ******   LedControl Library is required to drive the MAX7219 7 segment LED displays.  *******
                                                        // led_Display_1 is the variable name of my set of displays chained
    LedControl led_Display_1 = LedControl(12,10,11,8);  // together running off of pins 12,11,10.  
                                                        // Pin 12 is the DataOut 
                                                        // Pin 11 is Load or CS
                                                        // Pin 10 is clock. 
                                                        // The 8 is for how many displays you have to chain.
                                                        // I have 4 but put 8 incase of expansion. It cost no memory.
                                                        // You can run any pins you want in the instruction, 
                                                        // just plug the module in correctly.
                                                        // LedControl(Data,Clock,Load,Displays)
                                                        // I used 12,10,11 so I could have a straight ribbon connection
                                                        // from the module without crossing leads.
    
    
    int CodeIn;// used on all serial reads
    String Digit;    // Variable as a string to take from getChar()
    int Count;       // This variable used in loops in the EQUALS() function
    int vs[4]; // AP_alt_set[5] is an array of the 5 digits that are the Auto Pilot AltitudeSet
    int KpinNo; 
    int Koutpin;
    
    
    String KoldpinStateSTR, KpinStateSTR, Kstringnewstate,Kstringoldstate;
    
    
    void setup() 
    {
      Kstringoldstate = "111111111111111111111111111111111111111111111111111111111111111111111";
    
    
      for (int KoutPin = 2; KoutPin <=9; KoutPin++)// Get all the pins ready for simconnect codes and "Keys"(all inputs)  
      {
        pinMode(KoutPin, INPUT);
        digitalWrite(KoutPin, HIGH); 
       
     //The MAX72XX is in power-saving mode on startup, we have to do a wakeup call
        delay (500);
        led_Display_1.shutdown(0,false);      // I have 4 displays, these start them up
       // delay (500);                          // I put the delay in so they all dont start drawing
       // led_Display_1.shutdown(1,false);      // current at the same time.
       // delay (500);                          // I had an issue with running on only USB power and getting a display glitch.
       // led_Display_1.shutdown(2,false);      // The delay seems to have fixed this issue.
       // delay (500);
       // led_Display_1.shutdown(3,false);
        
        // Set the brightness to a lower than medium values 
       led_Display_1.setIntensity(0,8);
       // led_Display_1.setIntensity(1,8);
       // led_Display_1.setIntensity(2,8);
        //led_Display_1.setIntensity(3,8);
        
        // and clear the display 
        led_Display_1.clearDisplay(0);
       // led_Display_1.clearDisplay(1);
        //led_Display_1.clearDisplay(2);
        //led_Display_1.clearDisplay(3);
    
    
     Serial.begin(115200);   
    }
    }
    
    
    void loop() {
      {INPUTS();} //Check the Simconnect and "keys" section for any input pins
      {OTHER();} //voidto use  for other extractions
      
      if (Serial.available()) {//checks the serial read buffer
        CodeIn = getChar();// reads one charactor via it's own routine (char getChar)
          if (CodeIn == '#') {OTHER();}// The first identifier is "#", goto OTHER void
      }
    }
    
    
    char getChar()// Get a character from the serial buffer
    {
      while(Serial.available() == 0);// wait for data
      return((char)Serial.read());// Thanks Doug
    }// end of getchar void. 
    
    
    void OTHER(){    // The first identifier was "<"
    CodeIn = getChar(); // Get the second identifier
      switch(CodeIn) {// Now lets find what to do with it
        
        case 'G':           //  AUTOPILOT VERTICAL HOLD VAR
                Count = 0;               // clear the Count
                while (Count < 4)        // we will count to 4 from 0 to 4
                {
                    Digit = "";          // clears the string variable Digit
                    Digit += getChar();  // Makes the string Digit what ever getChar() is holding
                      if (Digit ==".")          // ******   This looks for the "." *************
                {
            Digit = "";           // If we find the "." we clear it and get the next digit
            Digit += getChar();  //  Because we know where the "." always goes. 
                } 
                    vs[Count] = Digit.toInt(); // Turns the string Digit into an Integer and
                                                       // then stores it in the Array AUTOPILOT VERTICAL HOLD VAR[] 0,1,2,3
                    Count++;
                }
                     
                led_Display_1.setDigit(0,3,vs[1],false);   // First digit of Alt Set is displayed 
                led_Display_1.setDigit(0,2,vs[2],false);   // Second digit of Alt Set is displayed 
                led_Display_1.setDigit(0,1,vs[3],false);   // Third digit of Alt Set is displayed 
                led_Display_1.setDigit(0,0,vs[4],false);   // Fourth digit of Alt Set is displayed 
                                                                  
         }// end of switch
    }// end of OTHER void
    
    
    void INPUTS(){ // Simconnect codes and "Keys" section. 
      // Any code beginning with a Z is from the expert controls section
      Kstringnewstate = "";
      for (int KpinNo = 2; KpinNo <=9; KpinNo++){ //set this to the input pins. (pins 10 to 19)
        KpinStateSTR = String(digitalRead(KpinNo)); //read the state of the pin
        KoldpinStateSTR = String(Kstringoldstate.charAt(KpinNo - 2));// gets the 'old' state of the pin from string
        if (KpinStateSTR != KoldpinStateSTR){// checks if it's different to the last reading of that pinNo
          if (KpinNo != 13){ // avoid using pin 13 as an input unless you know the tricks.
            if (KpinNo == 2 && KpinStateSTR == "0"){Serial.println ("B01");} //AutoPilot
            if (KpinNo == 2 && KpinStateSTR == "0"){Serial.println ("B301");} //Flight Director On
            if (KpinNo == 3 && KpinStateSTR == "0"){Serial.println ("B30");} //Toggle Flight Director
            if (KpinNo == 4 && KpinStateSTR == "0"){Serial.println ("Z051");} //Toggle Heading
            if (KpinNo == 5 && KpinStateSTR == "0"){Serial.println ("B10");} //Toggle Nav Hold
            if (KpinNo == 6 && KpinStateSTR == "0"){Serial.println ("B08");} //Toggle APP Hold
            if (KpinNo == 7 && KpinStateSTR == "0"){Serial.println ("B09");} //Toggle BC
            if (KpinNo == 8 && KpinStateSTR == "0"){Serial.println ("Z061");} //Toggle Alt Hold
            if (KpinNo == 9 && KpinStateSTR == "0"){Serial.println ("Z041");} //Toggle Alt Arm
    
    
            //  Add more here but remember to also change the figure in the next line down. (the 14)
            // now the "Keys" bit ,,,
        }//end of 'its different'       
        Kstringnewstate += KpinStateSTR;
      }//end of 'for' loop (read the pins)
      Kstringoldstate = Kstringnewstate;
    }//end of INPUTS void
    }

  2. #2
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    238
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    Marc,
    Vertical Speeds are in the default Extractions
    If you want AutoPilot Vertical Speed setting the extraction is "=c"
    If you want the Actual Vertical Speed of the aircraft the extraction is (Less Than)L
    (The forum code wont print the Less Than sign)

    You need to take out the first call for "OTHER()" under "INPUTS()"
    It gets called from the "If" statement below it.
    The AP Vertical speed has no "."
    Try this...It should work for stock. It has an IF statement that blanks the VS display if it is 0000.
    Code:
    case 'c':    //  AP vertical speed set
            Count = 0;
            while (Count < 4)
            {
                Digit = "";
                Digit += getChar(); 
                if (Count == 0)
                {
                    if (Digit == "-")
                    {
                        AP_vs_minus = '-';
                    }
                    else 
                    {
                        AP_vs_minus = ' ';
                    }
                    Digit = "";
                    Digit += getChar();
                }
                AP_vs_set[Count] = Digit.toInt();
                Count++;
            }
            if ( AP_vs_set[0] == 0 && AP_vs_set[1] == 0 )
            {
                led_Display_1.setChar(2,4,' ',false);
                led_Display_1.setChar(2,3,' ',false);
                led_Display_1.setChar(2,2,' ',false);
                led_Display_1.setChar(2,1,' ',false);
                led_Display_1.setChar(2,0,' ',false); 
            }
            else
            {
                led_Display_1.setChar(2,4,AP_vs_minus,false);
                led_Display_1.setDigit(2,3,AP_vs_set[0],false);
                led_Display_1.setDigit(2,2,AP_vs_set[1],false);
                led_Display_1.setDigit(2,1,AP_vs_set[2],false);
                led_Display_1.setDigit(2,0,AP_vs_set[3],false);
            }
    break;
    Also, you'll need to change the addressing for what display gets the digits.

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  3. #3
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    Thank Fess,
    I am such a muppet. I have been looking at those extractions for hours and never saw the autopilot vertical speed."Should have gone to specsavers"

    many thanks
    Marc

  4. #4
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    You are not alone. Keep looking for solutions in the Experts tab. I don't know what math was used to turn an input of 400 fps into 2.032 output using AUTOPILOT VERTICAL HOLD VAR. '2.032' is what my failing memory recalls. If you divide 400 by the raw SimConnects output, and plug that into the 'equations' box, eg. *196.85, this will return your original upload to Link2FS. The format box can be used to round or truncate the result before downloading to your board. Format '000' will turn '12345.85' in line #A into a download of "#A123".

    Hugh
    Last edited by BushPilotWannabe; 07-13-2017 at 11:19 AM. Reason: #A123 is a string of chars
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  5. #5
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    Hi guys, so I have had a play with that code, here it is.
    Code:
    #include "LedControl.h"  
    #include "math.h" 
         
                                   // ******   LedControl Library is required to drive the MAX7219 7 segment LED displays.  *******
                                                        // led_Display_1 is the variable name of my set of displays chained
    LedControl led_Display_1 = LedControl(12,10,11,8);  // together running off of pins 12,11,10.  
                                                        // Pin 12 is the DataOut 
                                                        // Pin 11 is Load or CS
                                                        // Pin 10 is clock. 
                                                        // The 8 is for how many displays you have to chain.
                                                        // I have 4 but put 8 incase of expansion. It cost no memory.
                                                        // You can run any pins you want in the instruction, 
                                                        // just plug the module in correctly.
                                                        // LedControl(Data,Clock,Load,Displays)
                                                        // I used 12,10,11 so I could have a straight ribbon connection
                                                        // from the module without crossing leads.
    
    
    int CodeIn;// used on all serial reads
    String Digit;    // Variable as a string to take from getChar()
    int Count;       // This variable used in loops in the EQUALS() function
    int AP_vs_set[4]; // AP_alt_set[5] is an array of the 5 digits that are the Auto Pilot AltitudeSet
    int AP_vs_minus[4];
    int KpinNo; 
    int Koutpin;
    
    
    String KoldpinStateSTR, KpinStateSTR, Kstringnewstate,Kstringoldstate;
    
    
    void setup() 
    {
      Kstringoldstate = "111111111111111111111111111111111111111111111111111111111111111111111";
    
    
      for (int KoutPin = 2; KoutPin <=9; KoutPin++)// Get all the pins ready for simconnect codes and "Keys"(all inputs)  
      {
        pinMode(KoutPin, INPUT);
        digitalWrite(KoutPin, HIGH); 
       
     //The MAX72XX is in power-saving mode on startup, we have to do a wakeup call
        delay (500);
        led_Display_1.shutdown(0,false);      // I have 4 displays, these start them up
       // delay (500);                          // I put the delay in so they all dont start drawing
       // led_Display_1.shutdown(1,false);      // current at the same time.
       // delay (500);                          // I had an issue with running on only USB power and getting a display glitch.
       // led_Display_1.shutdown(2,false);      // The delay seems to have fixed this issue.
       // delay (500);
       // led_Display_1.shutdown(3,false);
        
        // Set the brightness to a lower than medium values 
       led_Display_1.setIntensity(0,8);
       // led_Display_1.setIntensity(1,8);
       // led_Display_1.setIntensity(2,8);
        //led_Display_1.setIntensity(3,8);
        
        // and clear the display 
        led_Display_1.clearDisplay(0);
       // led_Display_1.clearDisplay(1);
        //led_Display_1.clearDisplay(2);
        //led_Display_1.clearDisplay(3);
    
    
     Serial.begin(115200);   
    }
    }
    
    
    void loop() {
      {INPUTS();} //Check the Simconnect and "keys" section for any input pins
    
    
      
      if (Serial.available()) {//checks the serial read buffer
        CodeIn = getChar();// reads one charactor via it's own routine (char getChar)
          if (CodeIn == '=') {EQUALS();}// The first identifier is "#", goto OTHER void
      }
    }
    
    
    char getChar()// Get a character from the serial buffer
    {
      while(Serial.available() == 0);// wait for data
      return((char)Serial.read());// Thanks Doug
    }// end of getchar void. 
    
    
    void EQUALS(){    // The first identifier was "<"
    CodeIn = getChar(); // Get the second identifier
      switch(CodeIn) {// Now lets find what to do with it
        
       case 'c':    //  AP vertical speed set
            Count = 0;
            while (Count < 4)
            {
                Digit = "";
                Digit += getChar(); 
                if (Count == 0)
                {
                    if (Digit == "-")
                    {
                        AP_vs_minus = '-';
                    }
                    else 
                    {
                        AP_vs_minus = ' ';
                    }
                    Digit = "";
                    Digit += getChar();
                }
                AP_vs_set[Count] = Digit.toInt();
                Count++;
            }
            if ( AP_vs_set[0] == 0 && AP_vs_set[1] == 0 )
            {
                led_Display_1.setChar(0,4,AP_vs_set,false);
                led_Display_1.setChar(0,3,AP_vs_set,false);
                led_Display_1.setChar(0,2,AP_vs_set,false);
                led_Display_1.setChar(0,1,AP_vs_set,false);
                led_Display_1.setChar(0,0,AP_vs_set,false); 
            }
            else
            {
                led_Display_1.setChar(0,4,AP_vs_minus,false);
                led_Display_1.setDigit(0,3,AP_vs_set[0],false);
                led_Display_1.setDigit(0,2,AP_vs_set[1],false);
                led_Display_1.setDigit(0,1,AP_vs_set[2],false);
                led_Display_1.setDigit(0,0,AP_vs_set[3],false);
            }
                                                                  
         }// end of switch
    }// end of OTHER void
    
    
    void INPUTS(){ // Simconnect codes and "Keys" section. 
      // Any code beginning with a Z is from the expert controls section
      Kstringnewstate = "";
      for (int KpinNo = 2; KpinNo <=9; KpinNo++){ //set this to the input pins. (pins 10 to 19)
        KpinStateSTR = String(digitalRead(KpinNo)); //read the state of the pin
        KoldpinStateSTR = String(Kstringoldstate.charAt(KpinNo - 2));// gets the 'old' state of the pin from string
        if (KpinStateSTR != KoldpinStateSTR){// checks if it's different to the last reading of that pinNo
          if (KpinNo != 13){ // avoid using pin 13 as an input unless you know the tricks.
            if (KpinNo == 2 && KpinStateSTR == "0"){Serial.println ("B01");} //AutoPilot
            if (KpinNo == 2 && KpinStateSTR == "0"){Serial.println ("B301");} //Flight Director On
            if (KpinNo == 3 && KpinStateSTR == "0"){Serial.println ("B30");} //Toggle Flight Director
            if (KpinNo == 4 && KpinStateSTR == "0"){Serial.println ("Z051");} //Toggle Heading
            if (KpinNo == 5 && KpinStateSTR == "0"){Serial.println ("B10");} //Toggle Nav Hold
            if (KpinNo == 6 && KpinStateSTR == "0"){Serial.println ("B08");} //Toggle APP Hold
            if (KpinNo == 7 && KpinStateSTR == "0"){Serial.println ("B09");} //Toggle BC
            if (KpinNo == 8 && KpinStateSTR == "0"){Serial.println ("Z061");} //Toggle Alt Hold
            if (KpinNo == 9 && KpinStateSTR == "0"){Serial.println ("Z041");} //Toggle Alt Arm
    
    
            //  Add more here but remember to also change the figure in the next line down. (the 14)
            // now the "Keys" bit ,,,
        }//end of 'its different'       
        Kstringnewstate += KpinStateSTR;
      }//end of 'for' loop (read the pins)
      Kstringoldstate = Kstringnewstate;
    }//end of INPUTS void
    }
    It wont compile it comes up wit the error incompatible types in assignment of 'char' to 'int [4]'

    Am I also right in thinking that I would need to add an int AP_vs_minus[4]; at the top?

    Many thanks
    Marc

  6. #6
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    EDIT

    under construction

    I've got nothing except to recommend that you to clean the code up as you go along. Correct or delete any misleading comments. If possible leave for(), while(), and arrays[] until the code is working, then bring them in to condense the script.

    Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  7. #7
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    238
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    AP_vs_minus can be a character or string variable not an integer.
    So at the top where variables are declared...

    char AP_vs_minus;
    or
    String AP_vs_minus;

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  8. #8
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    Thanks for your help so far guys. I did get it working and then added a couple of buttons and then it stopped working so I removed the buttons again but now it wont work at all by ot work I mean my 7 segment display stays blank. It's not the display because it works with other code.
    The code is below. I am using an arduino nano. Thanks Marc

    Code:
    #include "LedControl.h"
    
    
    
    
    // ******   LedControl Library is required to drive the MAX7219 7 segment LED displays.  *******
    // led_Display_1 is the variable name of my set of displays chained
    LedControl led_Display_1 = LedControl(12, 11, 10, 8); // together running off of pins 12,11,10.
    // Pin 12 is the DataOut
    // Pin 11 is Load or CS
    // Pin 10 is clock.
    // The 8 is for how many displays you have to chain.
    // I have 4 but put 8 incase of expansion. It cost no memory.
    // You can run any pins you want in the instruction,
    // just plug the module in correctly.
    // LedControl(Data,Clock,Load,Displays)
    // I used 12,10,11 so I could have a straight ribbon connection
    // from the module without crossing leads.
    
    
    int CodeIn;// used on all serial reads
    String Digit;    // Variable as a string to take from getChar()
    int Count;       // This variable used in loops in the EQUALS() function
    int AP_vs_set[4]; // AP_alt_set[5] is an array of the 5 digits that are the Auto Pilot AltitudeSet
    char AP_vs_minus;
    
    
    
    
    
    
    
    
    
    
    void setup()
    {
      //The MAX72XX is in power-saving mode on startup, we have to do a wakeup call
      delay (500);
      led_Display_1.shutdown(0, false);     // I have 4 displays, these start them up
      // delay (500);                          // I put the delay in so they all dont start drawing
      // led_Display_1.shutdown(1,false);      // current at the same time.
      // delay (500);                          // I had an issue with running on only USB power and getting a display glitch.
      // led_Display_1.shutdown(2,false);      // The delay seems to have fixed this issue.
      // delay (500);
      // led_Display_1.shutdown(3,false);
    
    
      // Set the brightness to a lower than medium values
      led_Display_1.setIntensity(0, 8);
      // led_Display_1.setIntensity(1,8);
      // led_Display_1.setIntensity(2,8);
      //led_Display_1.setIntensity(3,8);
    
    
      // and clear the display
      led_Display_1.clearDisplay(0);
      // led_Display_1.clearDisplay(1);
      //led_Display_1.clearDisplay(2);
      //led_Display_1.clearDisplay(3);
    
    
      Serial.begin(115200);
    }
    
    
    void loop() {
      {
        INPUTS(); //Check the Simconnect and "keys" section for any input pins
      }
    }
    
    
    char getChar()// Get a character from the serial buffer
    {
      while (Serial.available() == 0); // wait for data
      return ((char)Serial.read()); // Thanks Doug
    }// end of getchar void.
    
    
    void EQUALS() {   // The first identifier was "="
      CodeIn = getChar(); // Get the second identifier
      switch (CodeIn) { // Now lets find what to do with it
    
    
        case 'c':    //  AP vertical speed set
          Count = 0;
          while (Count < 4)
          {
            Digit = "";
            Digit += getChar();
            if (Count == 0)
            {
              if (Digit == "-")
              {
                AP_vs_minus = '-';
              }
              else
              {
                AP_vs_minus = ' ';
              }
              Digit = "";
              Digit += getChar();
            }
            AP_vs_set[Count] = Digit.toInt();
            Count++;
          }
          if ( AP_vs_set[0] == 0 && AP_vs_set[1] == 0 )
          {
            led_Display_1.setChar(0,3, AP_vs_set[0], false);
            led_Display_1.setChar(0,2, AP_vs_set[1], false);
            led_Display_1.setChar(0,1, AP_vs_set[2], false);
            led_Display_1.setChar(0,0, AP_vs_set[3], false);
          }
          else
          {
            led_Display_1.setChar(0,4, AP_vs_minus, false);
            led_Display_1.setDigit(0,3, AP_vs_set[0], false);
            led_Display_1.setDigit(0,2, AP_vs_set[1], false);
            led_Display_1.setDigit(0,1, AP_vs_set[2], false);
            led_Display_1.setDigit(0,0, AP_vs_set[3], false);
          }
    
    
    
    
    
    
      }// end of switch
    }// end of OTHER void
    
    
    
    
    void INPUTS() // Simconnect codes and "Keys" section
    {
    
    
    }//end of INPUTS void

  9. #9
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    What happened to void loop()'s call to EQUALS()


    You are jumping back and forth amongst strings, chars, and integers.
    If case c:{ provides display only, it can be done entirely with char variables.

    When the sketch works to your satisfaction, change each charX to an element of an array, and put the last three characters into a for() loop.


    case 'c':{ // AP vertical speed set

    char char0, char1, char2, char3, char4;

    char0 = getChar();
    if ( char0 == '-') { char1 = getChar();}
    else{ char1 = char0; char0 = ' ';}
    char2 = getChar();
    char3 = getChar();
    char4 = getChar();

    led_Display_1.setChar(0,4, char0, false);
    led_Display_1.setChar(0,3, char1, false);
    led_Display_1.setChar(0,2, char2, false);
    led_Display_1.setChar(0,1, char3, false);
    led_Display_1.setChar(0,0, char4, false);
    }// close case c:
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  10. #10
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simconnect extractions Expert

    Thanks guys. All working now. I know when its time to make a break because I start to make silly mistakes.
    Fess mentioned that the if statement will blank the display if it is 0000. at the moment the screen displays 0000 but does not go blank.
    Any ideas.

    Oh it's ok figured it out. Could this same if statement work to turn displays off if battery or master avionics is off?
    Kind regards
    Marc