Page 4 of 10 FirstFirst 12345678 ... LastLast
Results 31 to 40 of 99
  1. #31
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    763
    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 COM / NAV LED display - FSX

    Just carry on with what you were doing James ,, its an excellent challenge for you ,,, we were just tossing options/idea's around and like you,, it's also a learning curve for the rest of us. (I seem to laterally think too much sometimes though.)

    Now the parts etc ,, yes I suppose its just the "waiting" and the postage ,,, us$30 is about nz$50 so it is quite substantial when it comes to getting only a few bits.... BUT I might actually do what you suggest ,,, add up a large shopping list and go for it.
    I do want to get some of those buttons you got (Square-ish with the LED) and also a couple of those 40 x 2 LCD screens ,, so the list has started already.

    Aaaahhhh when will it end ??? Aint it fun though ,,, Cheers ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  2. #32
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    230
    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 COM / NAV LED display - FSX

    I have some more great news... a trial interface from the NAV/COM display to FSX OUT yielded excellent results! I now feel comfortable continuing on with the original plan. However, it took me several hours to get there since I could not actually "see" what FSX Out was sending to the Arduino. After a stab in the dark, I found that FSX was sending the ascii code for each digit, i.e. 49 == "1". (smart people already knew this ). Once I determined that, I researched how to convert ascii code to the actual character - to no avail did any code work. So instead, I incorporated lengthy "switch/case" codes for each digit of my display. I know that there is an easier way. Any help would be appreciated.

    Once that was completed, I began wishing I could use my "rotary encoder" to manipulate the freq. Then, I had an idea - "What if Jim would let us determine whether we want to use a hard input to FSX Out OR send a serial command (either determined by Jim OR allow FSX Out to be used as a "repeater" to SimConnect)." This would also come in handy for the overhead panel when starting the jet engines - certain logic sequences must be met before the "engine start" command is given. Just an idea.

    I have reached another level of gratification... going back to the tedious task of soldering.
    -James

  3. #33
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    230
    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 COM / NAV LED display - FSX

    Oh, and Jim.... I made an effortless mod to the code to display the altitude; that was cool!

  4. #34
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    763
    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 COM / NAV LED display - FSX

    Great stuff James,, more progress. You covered a lot of ground in your post, so I'll right into it.

    You appear to be getting messed up with Strings and Integers with manipulating the data.
    Yes ,, the Arduino receives the Ascii code of 49 to indicate the ascii character of "1". (Quite normal)
    Now ,,,,, in my PDE code ,,,
    String airsp;
    airsp = char(Serial.read());
    airsp being a string, is getting the actual ascii charator "1"
    (The serial read is getting 49 but the "char" in front of the "serial.read" is converting it to a character.)

    Now,,, I had a quick look again at your PDE file (excellent programming by the way) and earlier on, you are only dealing with integers so what you could try is ,,,
    int airsp;
    airsp = serial.read()
    // you dont need this one (Your fixed first didgit),, then ,,
    airsp = serial.read()
    // now send that to your second digit. ,,,then ,,
    airsp = serial.read()
    // now send that to your third digit. ,,,etc etc.
    The integer "airsp" is holding 49 and NOT a string of "1" (or whatever equivelant codes that it receives)
    The above assumes you want the 49 going thru your code which you would probably convert to an ascii character at some stage in your loop.
    You shouldnt need a "converting stage" as the Arduino software has converters "built in" ,, you just need to use them at the right place.
    I could be away off the mark here James but it's all I can think of at this stage without digging deeply into your present PDE code and I havent got the same hardware as you to test anything.

    Now,, the rotary encoders ,,, you need to start using "Link2fs_FSX_inOut" and you will be able to use you encoder switching system straight away thru the "Keys" section. Piece of cake !!! Just trigger a pin for going up,, and another pin for going down. I have actually done that here in my testing.
    Soooo,,,, you have your readout going,, and now by turning your switch encoder thingy,,, the digits will change. good luck !!!!

    Direct input to simconnect ,,, its in the future I think James ,,, I use direct input with that "link2fs_arduino_Uno1" and it is a logical way to go. Its going to be interesting shortly as to where we actually do end up,,,, The options are huge !!!!! and as for a complete overhead, complete with the required logic,,, I dont see any reason why not although it would be a huge mission so its probably later, rather than sooner. Very do-able though,,, once its actually done, then its easy for anyone else to copy.

    Good luck James ,,,, Jim

    Edit ,,
    MMMMMMMMmmmmm I just remembered the way your driving the the LED James (Charlie-plexing) ,,sooooo,, the above is probably not much help to you ,,,, Back to the drawing board !
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  5. #35
    25+ Posting Member
    Join Date
    Apr 2007
    Location
    SC
    Posts
    71
    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 COM / NAV LED display - FSX

    Just for yuks, while on that point...take a look around lines 164 to 175 here. I was working through the flap indicator yesterday... Simply subtracting the asci value of zero allowed conversion to an int.... Might not be the best approach, but It worked.. I have not yet corrected and cleaned up that entire file yet... So don't look too close.
    Last edited by mndless; 07-10-2011 at 10:24 AM. Reason: sp

  6. #36
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    230
    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 COM / NAV LED display - FSX

    LOL - Thanks for the valuable tip mndless. I checked my post early this morning and went back to the drawing board. Where were you?! After several more unsuccessful attempts of conversion, a light bulb went off! After testing it, I went to post my new findings and had seen your post. (i am still laughing) You're right- simple, but it works! Thanks again for the contribution mndless.
    com1b = (Serial.read()); // aBc.def
    MHZLED2 = (com1b-48 ) ;

    As for the rotary encoder, I may have progessed further than you realize, Jim. It was a 12pos rotary switch until I broke off the "stop cam"; this now allowed me to endlessly rotate the shaft in either direction. The PDE knows whether to increase or decrease the freq by remembering which pin was HIGH last. I guess you could say it's a 3-bit encoder. As I had written in a previous post, I can rotate in either direction very quickly with no misses. I'm kinda patting myself on the back for that one.

  7. #37
    25+ Posting Member
    Join Date
    Apr 2007
    Location
    SC
    Posts
    71
    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 COM / NAV LED display - FSX

    Quote Originally Posted by JMeller View Post
    com1b = (Serial.read()); // aBc.def
    MHZLED2 = (com1b-48 ) ;
    Almost... in your example above, you have to collect each char ( letter ) and subtract 48 each time, then, reassemble... so you'd have 6 int vars and 1 char ...

    there has to be a more "programmatically proper" way to do this... but it works...

  8. #38
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    230
    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 COM / NAV LED display - FSX

    Since the display is Charlieplexed, it has to be written this way. The numbers never get reassembled. In a previous posted code prior to LinkFS IN/OUT, the numbers were assembled and I had to extrapolate each digit using this code:
    MHZLED2 = Com1MHZ / 10;
    MHZLED3y = (float)Com1MHZ/10.00;
    MHZLED3 = (MHZLED3y - MHZLED2)*10;
    ____________________________________
    KHZLED1 = Com1KHZ / 10;
    KHZLED2y = (float)Com1KHZ/10.00;
    KHZLED2 = (KHZLED2y - KHZLED1)*10;

    With the Charlieplexing, the values are constantly changing to form the digits of comm1 AND comm2 by turning on & off one digit at a time (very rapidly) . I have since deleted the code above and rip out each digit from Jim's serial string. And I agree, there has to be a proper way.
    By the way, I took a long look at your website -Very nice!
    Last edited by JMeller; 07-10-2011 at 12:01 PM. Reason: sp

  9. #39
    25+ Posting Member
    Join Date
    Apr 2007
    Location
    SC
    Posts
    71
    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 COM / NAV LED display - FSX

    Thanks....

    Since the display is Charlieplexed
    I have not yet had the pleasure of experiencing charlieplexing... its on the "to learn" list... just not there yet!

    Thanks for keeping us up to date on your progress!

  10. #40
    10+ Posting Member venenoso's Avatar
    Join Date
    Aug 2007
    Location
    SCJO
    Posts
    19
    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 COM / NAV LED display - FSX

    Hello,
    Impressive , I have an arduino one and a lot of 7 display leds , is there any recip for cooking the comm or nav , that I could try?, some diagram to atach the arduino to the displays? , I dont know to much about programming and less in electronics.
    Regards

Page 4 of 10 FirstFirst 12345678 ... LastLast