Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    75+ Posting Member
    Join Date
    Feb 2010
    Location
    London
    Posts
    87
    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 Addon (airbus x) problems

    The other question is about programming the arduino

    Now as we know in airbus we have encoders with incorporated push and pull button now I have encoder with push button only
    so is there any way to programme it so on one press it would send one command and on the other a different command?

    So for example we have a HDG bug on the panel, press it and you have"-------*" displayed on the display of heading pull it and you have say"231" displayed.
    So with my encoder incorporating only push button I want to push it and have "--------*" displayed, and on another push i want to have digits displayed
    on next push dashes and on next one digits and so on.
    any idea how to do that

  2. #2
    300+ Forum Addict Tom_G_2010's Avatar
    Join Date
    Mar 2011
    Location
    Central Mass
    Posts
    437
    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 Addon (airbus x) problems

    What about click and double click? I've never attempted such with an Arduino but I have with LUA code and FSUIPC so I would think you could do the same on an Arduino. Set up a timer that starts on the first button push, if a second does not occur within x milliseconds treat it is a push if the second click comes within that time treat it as a pull.
    https://www.facebook.com/mycessnasim PC: Intel Core i7 Haswell @ 3.8GHz, 8Gb Ram, Win 7 64Bit, dual SSDs, GeFroce 780 SIM: FSX w/Aclrtn Pk, FSUIPC4, ASN, UTX, GEX, REX 4

  3. #3
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    232
    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 Addon (airbus x) problems

    Yes, easily done.

    int Push =0;
    void setup{}

    void loop{
    button = digitalRead(inputPin);
    if (button == HIGH) {Push = Push +1;}
    if (Push == 2 && button == HIGH ) {Push = 0;} //reset to zero if Push == 2
    if (Push == 0 && button == HIGH) { do this;}
    if (Push == 1 && button == HIGH) { do that;}
    } // end void loop


    NOTE: because the loop executes so rapidly, you'll need to add an old_button state versus current button state to prevent cycling.

    Hope this helps.
    JM

  4. #4
    75+ Posting Member
    Join Date
    Feb 2010
    Location
    London
    Posts
    87
    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 Addon (airbus x) problems

    the programe above sems as it might just do the trick
    but there is just one "but"
    say I got my ecoder button connected to pin 27
    and on the airbus panel it has to operate push and pull action and there are two key commnds shif ctrl f5 pof push and shift ctrl f6 for pull.
    So efectivly I have to assinf D27 to 2 difrent key combinations and link2fs wo't let me do that.

    Is there a way aroud that?
    becose tere are no simconnec codes for airbus panels in link2fs

  5. #5
    75+ Posting Member
    Join Date
    Feb 2010
    Location
    London
    Posts
    87
    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 Addon (airbus x) problems

    sorry for speling it's my wireless keybord

    the programe above sems as it might just do the trick
    but there is just one "but"
    say I got my ecoder button connected to pin 27
    and on the airbus panel it has to operate push and pull action and there are two key commands shift ctrl f5 for push and shift ctrl f6 for pull.
    So efectivly I have to put D27 with 2 difrent key combinations and link2fs won't let me do that.

    Is there a way aroud that?
    becose there are no simconnec codes for airbus panels in link2fs

  6. #6
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    232
    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 Addon (airbus x) problems

    Again, easily done. One must remember the Link2FS 'keys' are virtual; meaning, it doesn't care that it received D27 when ,in reality, the button was connected to pin12. That said, using the above example, it would look something like this:
    if (Push == 0 && button == HIGH) { serialPrintln("D270"); serialPrintln("D281");}
    if (Push == 1 && button == HIGH) { serialPrintln("D271"); serialPrintln("D280");}

  7. #7
    75+ Posting Member
    Join Date
    Feb 2010
    Location
    London
    Posts
    87
    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 Addon (airbus x) problems

    well good idea but it does not work as it should.

    but I think it may the add on Wilco evlution.

    Iteresting thing is that this add on hs it's own key assigments,they work from keyboard but not fro link2fs,
    and not from fsuipc.

    basicaly refering to above example you give me in the link2fs monitor I can see that d270 and d281 where send but the action in the sim was taken only from the first one (d270)

  8. #8
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    232
    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 Addon (airbus x) problems

    If it's not sending the second command, you'll have to insert a delay.

    The great thing about L2FS is its versatility. When you program it you'll tell it to simulate ; it simulates the key press - nothing to it.

    If it still doesn't work for ya, it's not due to L2FS's inability to do so.

    JM

  9. #9
    75+ Posting Member
    Join Date
    Feb 2010
    Location
    London
    Posts
    87
    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 Addon (airbus x) problems

    New fackts
    In Wilco Airbus vol2 (very important) for some reason link 2fs does not co-oporate only with the bug's,so speed bug hdg bug and so on.
    If I want to sent songle key or combinations of key to say press somthing it works great.

    So any chance that somthing had similar problems with add ons or with wilco add ons or with airbus general,
    and maybe soe one knows the solution.

  10. #10
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    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 Addon (airbus x) problems

    If what you want can be done with an ordinary keyboard ,,, then "Keys" should be able to do it ,, the keyboard and "Keys" both input into the same "bucket" that windows reads from.
    To send 2 commands quickly is not a good idea as there would have to be quite a few milliseconds between them.
    All the "sorting out" should be done on the Arduino with simple single commands being sent to FSX.

    Here's another option for you.

    To enter mode1 ,, push the knob briefly then release ,, mode 1 displays.
    To enter mode2 ,, push the knob and hold it down for a second ,, then release it ,, mode2 displays
    Once it's in the required mode ,, just turn the knob.

    In the above you would have different codes in the "Keys" section to do the required thing ,, but still only sending 1 code.
    The "mode" is sorted out on the Arduino card itself.
    You will have no doubt thought of that but I'm just checking.

    Cheers ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

Page 1 of 2 12 LastLast