Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jul 2014
    Location
    Santa Monica
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Autopilot + Radio

    Hi everyone.

    First, thanks Jim for Link2FS... it's amazing

    I would love to share my setup and sketch for your feedback and ideas.

    I have an arduino uno (some issues that i'll share later on) with three rotary encoders from adafruit and a saintsmart 20x4 I2C LCD. Here is a video with a small demo on how it works.



    The first encoder is used to navigate between the rows in the LCD (the arrow at the right), and if rotated while pushed then it navigates between "windows" (right now autopilot and radio, but i'll keep adding more).

    Second and third encoders behave differently based on the window and row active, in the AP, the middle encoder takes care of hdg bug, crs, ias and enabling/disabling ap, and the right one takes care of altitude, vertical speed, nav/gps mode and autothrottle arm. While in the radio window, the middle one takes care of Mhz and if you push it switches between active and standby and the right one Khz.

    The sketch is available on github: https://github.com/pandragoq/fscontroller/

    Next step will be adding a 4x4 keypad and some leds as annunciators.

    And now, the issues... you can see in the video, that the altitude goes back to =b000, found here that was an issue with the serial buffer (right now at 12, but when i set it to 256 the LCD doesn't even work. Any suggestions?

    Then, the altitude/heading hold as simconnect inputs, when i send either B04 or B05 it automatically assigns current hdg/altitude to hold... so in my code I detect this is going to be sent, save current hdg value, activate hold, and send A59XXX with the previous hdg. Is that the proper way? Or there is an input so it will keep the value and just activate the ap mode?

    Thanks a lot in advance for your feedback

  2. #2
    75+ Posting Member
    Join Date
    Apr 2014
    Location
    Tampa, FL, USA, Earth..umm
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Autopilot + Radio

    I did something close to that with the Arduino MEGA and the 20x4 LCD. I use a rotary switch to switch between "screens"/windows. One window is my MCP display, one is for COM1, NAV1, NAV2 and Transponder. Then I have 5 rotary encoders to change the radio/xponder values and 4 switches to swap active and standby freqs.

    I'm not using =b to get my MCP altitude, tho. I'm using the Experts section of Link2fs, FSUIPC (1). Because of a bunch of other identifiers I'm using, my MCP altitude is #i with offset 652E Type Short (no hex?) and format 00000

    Then my INO code is like this which is probably similar to what you have:

    ( under void POUND() )

    CodeIn = getChar(); // Get the second identifier
    switch(CodeIn) {// Now lets find what to do with it


    case 'i': // found AP altitude setting
    // delay (11);
    if (LCDMode == "1") {
    altit = "";
    altit += getChar();
    altit += getChar();
    altit += getChar();
    altit += getChar();
    altit += getChar();
    if (altit != altitold){
    lcd.setCursor(15,1);
    lcd.print(altit);
    altitold = altit;
    }
    }
    break;


    Mike

  3. #3
    New Member
    Join Date
    Jul 2014
    Location
    Canary Islands
    Posts
    1
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Autopilot + Radio

    Hi PandragoQ and Mikeb1028. Congrats for this work, is simply awesome. I'm trying to do a similar project, and will very helpfull if you show something like fritzing dispose or alike, maybe a photo of internals?

    Thanks

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

    Re: Autopilot + Radio

    The internals look pretty bad. Most of it is on a breadboard. The panel is black foam board :P

    BTW, now it has a 4x4 keypad, and i'm working on using it... latest version of the sketch in github is a bit broken

  5. #5
    75+ Posting Member vikingsraven's Avatar
    Join Date
    Dec 2012
    Location
    UK
    Posts
    89
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Autopilot + Radio

    you using keypad.h.
    the interrupts in there a re useful for key press detection.
    Nice job by the way!

  6. #6
    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: Autopilot + Radio

    Great code PandragoQ and I particularly like the way you've handled the received string (getString) and handled the writing to the LCD (printText).
    Very very nice.

    I haven't played with it yet (or tried to kill it) but I love it ,, it would really simplify code in a big INO.
    Even an old fart like me learns something new every day

    Thanks for posting it PandragoQ.

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

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

    Re: Autopilot + Radio

    Thanks for your words guys.

    Actually, with the heavy usage of String variables and concatenation, my code won't accept more features, and that's bad... so i'm rewriting some pieces to use less memory.

    I still have an issue with the buffer.... I would love to receive LOTS of variables into my arduino, and because the serialbuffer issues I've been thinking on a solution that could be implemented in link2fs (gladly i would help on the code).

    What if we could send a command to link2fs from the board to request a specific group of variables? Let's say I define a group "A" that contains all my radio variables, then I can ask "give me A", and i'll get all of them

    Another option would be to allow some kind of setup in the messages sent to arduino, in a way that instead of being all variables in the same line, i could split them into lines, with delays between them.

    Again, i'm still amazed by your code Jim, it completely changed the way I fly.

  8. #8
    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: Autopilot + Radio

    I did actually think of the same thing some time ago PandragoQ but opted to include the "more cards" as trying to do too much on a single card is just a recipe for trouble and the refresh burst just aggravates the situation.

    It's fine to throw heaps of data out to the card but the serial traffic has to cope with data going both ways with,, hopefully no extra lag.

    The bigger problem was overtaxing a very busy processor on the card and introducing more 'Lag' ,, missed events or memory trouble ,, my thoughts were to use an extra card if things get too "busy".

    Maybe throwing a shield on the Arduino and switching over to LAN would be better ???

    I haven't forgotten about it ,, just haven't seen the need yet but I'll have a fiddle and see how much of a mission it would be.

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

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

    Re: Autopilot + Radio

    Jim, you gave me an idea with the LAN support.... i'm going to use a Raspberry PI to receive all data through LAN, and proxy it to the arduino "on demand"

  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: Autopilot + Radio

    Mmmm ,,that's different.

    How many extractions are you pulling out ???
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

Page 1 of 2 12 LastLast