Results 1 to 5 of 5
  1. #1
    New Member
    Join Date
    Aug 2015
    Location
    Tanzania
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Question How do I make an Over head Pannel with link2fs?

    Hi Pilots,

    I am beginer with building flight sims. I recently learned arduino a course and I thought I could use that. I got Jim's Link2fs. I managed to program one toogle switch using the sim connect inputs. I could code only one input. When I tried to make one more using the same idea it did not work. Please help.

    If possible please email me.

    Thanks,
    Prem Udeshi
    premudeshi99@gmail.com

  2. #2
    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: How do I make an Over head Pannel with link2fs?

    Post your code, and someone will tell you where you went wrong.
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

  3. #3
    New Member
    Join Date
    Aug 2015
    Location
    Tanzania
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: How do I make an Over head Pannel with link2fs?

    Thanks BuzziBi

    Here is my code:

    Code:
     
    void setup() {
      // put your setup code here, to run once:
    Serial.begin(115200);
    pinMode(1, INPUT_PULLUP);
    pinMode(2, INPUT_PULLUP);
    pinMode(3, INPUT_PULLUP);
    pinMode(4, INPUT_PULLUP);
    }
    void loop() {
      // put your main code here, to run repeatedly:
    while(digitalRead(5) == LOW){
      Serial.println("E17");
     
    }
    while(digitalRead(2) == LOW){
    Serial.println ("C01");
    }
    while(digitalRead(3) == LOW){
    Serial.println ("E18");
    }
    while (digitalRead(4) == LOW){
    Serial.println ("C02");
    }
    }
    Thanks Prem

  4. #4
    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: How do I make an Over head Pannel with link2fs?

    Do not think you can use multiple switches in a "while" loop, and achieve what you want.
    Have a look at the "Multi_Keys_Gear_Simconnect", and work your way from there.
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

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

    Re: How do I make an Over head Pannel with link2fs?

    I think those while are meant to be if. But then the serial port will print continuously.
    The while is blocking and a bad idea in the loop function. One should monitor state changes and react accordingly. Here, print when last state differs from current state.

    As suggested, looking at functional examples is a good idea.