Results 1 to 7 of 7
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2016
    Location
    italia
    Posts
    7
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    arduino link2fs and pmdg.

    Hello everyone.
    I am new to the forum and I take this opportunity to introduce myself.
    I'm ushering me for the first time to the Arduino world.
    I would try to command the autopilot heanding PMDG 737 and I am going forward step by step.
    I got to the point of understanding the functioning of link2fs program and I know how to set it to send the command to rotate the plane heanding.
    I Occor an Arduino code that allows my rotary encoder to send the correct data to link2fs.
    can you give me a test file?
    Thanks.

  2. #2
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2016
    Location
    italia
    Posts
    7
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: arduino link2fs and pmdg.

    can any one help ?

  3. #3
    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: arduino link2fs and pmdg.

    How do you rotate the plane's heading? Are you using one of Jim's sketches? You may have to display the code that does not work.

    I do not use PMDG software but someone else will see the problem and give you a quick answer.

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

  4. #4
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2016
    Location
    italia
    Posts
    7
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: arduino link2fs and pmdg.


    I am using this rotary encoder .
    it has 4 pins connected as follows:
    clk = pin 2 Arduino
    dt = pin 3 Arduino
    + = 5V Arduino
    gnd gnd = arduino

    I miss the code that allows to rotate heanding or the speed of the PMDG 737 .
    the setting in espererti section link2fs was already set, I miss only a test code .
    can someone help me?
    thank you.
    Attached Images Attached Images

  5. #5
    New Member
    Join Date
    Mar 2016
    Location
    Australia
    Posts
    4
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: arduino link2fs and pmdg.

    Hi, I'm a bit confused. So have you figured out how to set the headings from link2fs to PMDG 737 or not? Or are you simply looking for a sketch to use the rotary encoder?

    I have a sketch that can use the rotary encoder to change IAS/Mach which works with regular FSX airplanes (I assume heading, altitude and all MCP data should also work), but I have problems sending it to PMDG airplanes as they use different events and offsets.

    Another thing is I also used this encoder Library:
    http://www.pjrc.com/teensy/td_libs_Encoder.html

    In case you only need the sketch, here is my sketch:
    Code:
    #include "Encoder.h"
    int speedAPEncoder;
    int speedAPEncoderOld;
    int speedAPEncoderDiff;
    
    
    Encoder speedAP(2,4);// change pin number to suit your build
    
    
    void setup() {
      Serial.begin(115200);   
    }
    
    void loop(){
      encoderAP();
    }
    
    void encoderAP(){
      speedAPEncoder = speedAP.read();
      speedAPEncoderDiff = (speedAPEncoder - speedAPEncoderOld);
      if (speedAPEncoderOld != speedAPEncoder){
      if (speedAPEncoderDiff ==-1){
        Serial.println("B15");} //increases IAS
      if (speedAPEncoderDiff == 1){
        Serial.println("B16");} //decreases IAS
      speedAPEncoderOld = speedAPEncoder;
      }
    }
    change the " in the first line #include "Encoder.h" to > and <

    Just install the Encoder library first, then run the sketch.
    I use pin 2 for Clk and 4 for DT. If you change this, also change the pin number in the sketch.
    If you want to control the heading instead, change the code in the line "increases/decreases IAS" accordingly.(B15 to A57 and B16 to A58 )

    One thing that I notice is that (assuming you are using the V Keyes encoder, which by the look of the picture is similar to mine) every time you rotate one click, it sends 2 clicks to link2fs instead.

    So if you figured out how to make this work with PMDG 737, could you please post how? And also if you can improve the sketch above, please post it as well.

    I hope everything is clear. Otherwise, feel free to ask.
    Last edited by barrizqi; 03-31-2016 at 06:50 AM. Reason: change in code

  6. #6
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2016
    Location
    italia
    Posts
    7
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: arduino link2fs and pmdg.

    when I go to check your code gives me the errors of the attached file .
    Attached Files Attached Files

  7. #7
    New Member
    Join Date
    Mar 2016
    Location
    Australia
    Posts
    4
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: arduino link2fs and pmdg.

    I made a new sketch. This sketch should be able to control Speed, heading and altitude as well as the C/O button for PMDG 737 NGX aircraft. Please read the read me on top of the sketch before doing anything.
    http://pastebin.com/p2yNGR3R