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

    Stab Trim - PMDG 737NGX

    Hello,

    I have a LCD 16x2 attached to an arduino and I'm trying to send the stab trim info to it.
    the variable I have tried the offset 0BC2 in expert section but it's still not the same value.

    Any idea how can I display the trim position ?

    Thanks,
    Ben

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

    Re: Stab Trim - PMDG 737NGX

    Here is my code, so now my question is : how I can apply a formula to a value "newstabtrim = (0.1289 x stabtrim) + 4.1"


    case 'H': //stabtrim test
    delay (11);
    stabtrim = "";
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();

    if (stabtrim != stabtrimold){
    lcd.setCursor(0, 0);
    delay (11);
    // newstabtrim = (0.1289 x stabtrim) + 4.1
    lcd.print("Trim : " + stabtrim);
    stabtrimold = stabtrim;
    }
    break;

  3. #3
    150+ Forum Groupie BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    275
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Stab Trim - PMDG 737NGX

    What is Trim in youre code?
    And can you not only use:
    case 'H': //stabtrim test
    delay (11);
    stabtrim = "";
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();

    lcd.print(stabtrim x 0.1289+4.1);

    break;
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

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

    Re: Stab Trim - PMDG 737NGX

    Thanks BuzziBi,

    You pointed me to the good direction, I have had to split the text "Trim :" and the integer, so now the + and * do the job.
    The trim is send to the Arduino via " The code working for me is :

    case 'H': // StabTrim
    delay (11);
    stabtrim = "";
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();
    stabtrim += getChar();

    if (stabtrim != stabtrimold){
    //lcd.begin(16,2);
    lcd.setCursor(0, 0);
    delay (11);
    lcd.print("Trim :" );
    lcd.setCursor(7, 0);
    delay (11);
    int newstabtrim = stabtrim.toInt(); // convert it to an integer (Thanks Phill)
    lcd.print(newstabtrim * 0.1289 + 4.1); // Correction to display PMDG StabTrim - (0.1289 x stabtrim) + 4.1 (Thanks Martin)
    stabtrimold = stabtrim;
    //Serial.print(stabtrimi); // Used for testing
    }
    break;

  5. #5
    150+ Forum Groupie BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    275
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Stab Trim - PMDG 737NGX

    OK.
    I noticed one thing.
    You need to determine whether it is necessary to use all the : delay (11);
    To many, and misuse of the delay (); function, just makes your code slow.
    Yust try to remowe one, and see if anything changes.
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------