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

    Link2FS and LCD 16x2

    Hello I'm riding a mcp for my PMDG 738 . and I'm having problem to extract the correct value of FL .
    example of the problem : when I put the level of flight FL32700 values ​​is ok . When I increase the flight level to FL32800 values ​​is thus -32,736 like to know what I do to fix this bug.
    thank you

  2. #2
    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: Link2FS and LCD 16x2

    Are you using unsigned integer for FL?


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

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

    Re: Link2FS and LCD 16x2

    Hello I was using INT and made a change to unsigned and nothing remains the same way can it be because my display is connected in 4-bit mode and not 8-bit thanks for the reply

  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: Link2FS and LCD 16x2

    What values show up in Link2FS SimConnects Extractions(1) for value at left arrow "D"?
    It might almost, maybe definitely be the use of integer. Run the sketch and toggle between unsigned int tempUnsignedInt = 0; and int tempUnsignedInt = 0;
    Check output on Link2FS monitor for rough chars.
    You didn't say anything about a minus sign.



    /* This is set up for a 20x4 display using I2C backpack. Change over code for your 16x2 display and library and delete the two lines in void setup() that end with "backpack"
    */

    #include "wire.h" //CHANGE QUOTATION MARKS TO POINTED BRACKETS
    #include "LiquidCrystal_I2C.h" //CHANGE QUOTATION MARKS TO POINTED BRACKETS
    LiquidCrystal_I2C lcd(0x3f,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified backpack

    char CodeIn;

    void setup() {
    // activate LCD module
    lcd.begin (20,4); // for 16x2 display change to (16x2)
    lcd.setBacklightPin(3,POSITIVE); //required for I2C backpack
    lcd.setBacklight(HIGH); // I2C backpack
    Serial.begin(115200);

    }

    void loop() {

    if (Serial.available()) { // now lets check the serial buffer for any input data
    CodeIn = GET_Char();
    if (CodeIn == '<') {LEFT();}// The first identifier is "<"
    } // end of serial available

    } // close loop()

    char GET_Char()// Get a character from the serial buffer
    {
    while(Serial.available() == 0);// wait for data
    return((char)Serial.read());// Thanks Doug
    }// close GET_Char()


    void LEFT(){ // The first identifier was "="
    CodeIn = GET_Char(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it

    case 'D':{ // Found the reading "ADF Active"
    int ADFFreq = 0; String tempString = ""; char tempChar; unsigned int tempUnsignedInt = 0;

    tempChar = (GET_Char()); Serial.print(tempChar);
    tempString += tempChar;
    tempUnsignedInt += (int((tempChar)-48 )*10000);
    tempChar = (GET_Char()); Serial.print(tempChar);
    tempString += tempChar;
    tempUnsignedInt += (int((tempChar)-48 )*1000);
    tempChar = (GET_Char()); Serial.print(tempChar);
    tempString += tempChar;
    tempUnsignedInt += (int((tempChar)-48 )*100);
    tempChar = (GET_Char()); Serial.print(tempChar);
    tempString += tempChar;
    tempUnsignedInt += (int((tempChar)-48 )*10);
    tempChar = (GET_Char()); Serial.println(tempChar);
    tempString += tempChar;
    tempUnsignedInt += (int((tempChar)-48 );
    lcd.setCursor(3,0); lcd.print("String "); lcd.print(tempString);
    lcd.setCursor(3,1); lcd.print("String "); lcd.print(tempUnsignedInt);
    }// close case 'E'
    break;
    } // close switch
    } // close LEFT()
    Last edited by BushPilotWannabe; 05-31-2016 at 01:22 PM. Reason: get rid of emodiwhatits
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

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

    Re: Link2FS and LCD 16x2

    hello I found the problem is with the program it already tells you the value burst of char have to use the word function only I did the test in another program that was giving this FSIO problem and it worked now have to adjust the link2fs what you think.
    hello I found the problem is with the program it already tells you the value burst of char have to use the word function only I did the test in another program that was giving this FSIO problem and it worked now have to adjust the link2fs what you think.

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

    Re: Link2FS and LCD 16x2

    this is my code because we have adappitar the function word

    void POUND(){


    delay (11);
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    case 'l'://Found the reading "Com1"
    alt = "";
    alt += char(Serial.read());
    alt += char(Serial.read());
    alt += char(Serial.read());
    alt += char(Serial.read());
    if (alt != altold && digitalRead(19) == LOW) {
    delay (11);
    lcd.setCursor(8, 0);
    delay (11);
    lcd.print(alt);

    }
    break;


    }
    this is my code because we have adappitar the function word

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

    Re: Link2FS and LCD 16x2

    hello would then have to ask for software developers make the alteration in the program as I told you the offset 652E of PMDG it's word and not int why it is giving error you know how I adiquiro the source code for me to change the program because I am in love with link2fs and would not want to migrate to other software.
    Quote Originally Posted by Eduardo Santino View Post
    this is my code because we have adappitar the function word

    void POUND(){


    delay (11);
    CodeIn = getChar(); // Get another character
    switch(CodeIn) {// Now lets find what to do with it
    case 'l'://Found the reading "Com1"
    alt = "";
    alt += char(Serial.read());
    alt += char(Serial.read());
    alt += char(Serial.read());
    alt += char(Serial.read());
    if (alt != altold && digitalRead(19) == LOW) {
    delay (11);
    lcd.setCursor(8, 0);
    delay (11);
    lcd.print(alt);

    }
    break;


    }
    this is my code because we have adappitar the function word

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

    Re: Link2FS and LCD 16x2

    hello would then have to ask for software developers make the alteration in the program as I told you the offset 652E of PMDG it's word and not int why it is giving error you know how I adiquiro the source code for me to change the program because I am in love with link2fs and would not want to migrate to other software.