Page 1 of 5 12345 LastLast
Results 1 to 10 of 44
  1. #1
    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

    Question Can Link2FS & Arduino do this . . . ????

    I'm part way into a build using a combination of Leo Bodnar cards for inputs and a couple Phidgets cards for outputs. In general all is going well but I've run into a few hick ups that are maddening. I just discovered this part of the forum and am now starting to explore whether Link2FS might help solve the issues I'm running into. So here are some initial questions as I start to read up on Link2FS and Arduino cards.

    1. I read that Link2FS can work with non Arduino cards. Has anyone attempted to use it with Phidgets cards? I have a Phidgets LED 64 and a Phidgets Servo controller adn it would be good not to loose the investment in them.

    2. Can I build logic in the code? For example can I read various FSX outputs and based on some set of thresholds or logic trigger an annunciator lamp? For example monitor altitude, gear position, and airspeed then set off a warning lamp if airspeed drops below 100n or altitude below 200 AGL and gear are not down.

    3. Is there any way to drive 7 segment LEDs using Link2FS and an Arduino? I have still not finalized how I'm going to build some of my avionics stack and being able to drive 7 segment LEDs for the freq display etc. is one of the issues. I am looking at other options like putting a face plate mask over a pc monitor, but I would really rather have actual 7 segment LEDs and my reading on some of the other solutions seem to be leading to coding complexity and money that are nor within reach at this time.

    Well, those are the first of the questions I came up with. I'm sure there are more to follow... THANKS!!!
    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

  2. #2
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can Link2FS & Arduino do this . . . ????

    1. I read that Link2FS can work with non Arduino cards. Has anyone attempted to use it with Phidgets cards? I have a Phidgets LED 64 and a Phidgets Servo controller and it would be good not to loose the investment in them.
    I'm not familiar with Phidgets products but it looks like they use a USB interface. This will be a problem for an Arduino board. It may be possible to interface to Phidgets boards but its going to require additional hardware and custom software.

    2. Can I build logic in the code? For example can I read various FSX outputs and based on some set of thresholds or logic trigger an annunciator lamp? For example monitor altitude, gear position, and airspeed then set off a warning lamp if airspeed drops below 100n or altitude below 200 AGL and gear are not down.
    The Arduino is an 8-bit microprocessor board which is programmed in the C Programming Language. Using LINK2FS you can get FSX data and then process that data. It would be a fairly simple task to set off a warning lamp based on plane conditions. However, it would be up to you to do the software. How are your C programming skills?

    3. Is there any way to drive 7 segment LEDs using Link2FS and an Arduino?
    Yes. A problem arises if you need more than one or two 7-segement displays. It's the number of pins required to control a single digit directly (7 pins plus 7 resistors to limit the current running through each segment). There are solutions to this problem -- see below.


    ARDUINO INFO
    =============

    The Arduino comes in a number of variation but the two primary ones ate the UNO and Mega2560. The UNO runs around $30 and the Mega2560 generally sells for $65. However, Mouser carries the Mega2560 for under $40. The arduino homepage is: Arduino - HomePage

    Adafruit and SparkFun are two companies that carry a lot of Arduino related products (including the UNO & Mega2560.
    Adafruit also has a great series of tutorials covering most of the products they carry or manufacture.
    http://www.adafruit.com
    SparkFun Electronics

    Adaifruit carries a 4-digit 7-segment display that uses an I2C interface. Eight of the boards can be connected to the same interface.
    Adafruit 0.56 4-Digit 7-Segment Display w/I2C Backpack - Red ID: 878 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits

    SparkFun has USB breakout boards that might be the solution to interfacing to the Pidgets boards.
    https://www.sparkfun.com/products/718

    Mega2560 at Mouser
    A000067 Arduino | Mouser

    Software development tools are free and can be downloaded from the Arduino web site. Versions for Windows, Mac OSX and Linux are available.
    Arduino - Software

  3. #3
    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: Can Link2FS & Arduino do this . . . ????

    Tom, your sim looks to be a real winner. I very nearly went down that same road but shells of aircraft are really rare in NZ. We tend to keep them flying until the rivits corrode away and bits fall off !!! and of course,,, by then it's too late to find a complete, undamaged cockpit.

    Flightsim and the Arduino ,,, I've never seen the Arduino as a threat to purpose made interface cards that seem to be everywhere now. I do how-ever see them as a very good alternative to the expensive cards where some-one wants to experiment with interfacing into (or out of) flightsim
    Arduino users tend to be the type of Guy (or Gal) that want to do everything themselves ,, the interface card must be cheap ,,, they do the coding ,,, and they do the construction of the unit (Auto pilot / radio's / motion platform etc) It's the personal challenge, rather than just going out and buying.
    These "experimenters" can interface a modest cockpit with Arduinos. Even some "high end" cockpits have Arduinos doing the odd-ball stuff which can be difficult with bought cards. This comes about because you can program the Arduino itself to do what you want.

    So to answer you questions Tom ,,,
    1/...
    No the Link2fs stuff wont interface with Phidgets cards.

    2/...
    You can install code into an Arduino that will do just that but it would be a pain ,,, you will need to reload the Arduino every time you changed planes.
    An easier option is to have the desktop software do it for you ,,, close to what you are talking about is in my (real early) ,,
    FSX arduino mega arduino duemilanove Uno flight simulator
    On the agenda is a project that has 14 annunciators that the triggers are mostly set by the user ,, 1 click plane change and 1 click install.
    When or if this is ever released is anyone's guess.

    3/...
    Yes ,, Have a look in these threads ,,,,
    http://www.mycockpit.org/forums/ardu...-displays.html
    http://www.mycockpit.org/forums/ardu...splay-fsx.html
    http://www.mycockpit.org/forums/ardu...fs-sketch.html
    Basically have a dig thru the Arduino sub-forums here in mycockpits.

    To sum up ,,,
    Use Leo's BU0836X for the inputs (Excellent card for inputs)
    Unless you are into coding and "do it yourself" stuff ,, stick with Phidgets cards or some other purpose made card that are made for the job.
    You look to be planning an advanced simulator and with the limitations of the Arduino coupled with the limited software for them (at the moment) it may cause you frustrations.

    Jeeze ,, I'm writting a book here !!!
    Cheers Tom ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  4. #4
    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: Can Link2FS & Arduino do this . . . ????

    Zulucat and Jim,

    Thanks for the feedback. Jim, I'm going to investigate the 7 segment solutions that you posted links to further as they appear to be within my reach both technically and in terms of cash outlay. The phidgets cards are in many ways no more purpose built that the Arduino cards, well, maybe a bit more, but in the end it still takes coding or at least scripting to get them to play ball with FSX. I have been using Alan Dyer's FS2Phidget interface app and have managed to get several things working.

    I have not however been able to solve for the 7 segment LEDs via that route. And my research into OC and SOIC says it requires more cash and coding than I might be up for just to run the 7 segment displays. In the end I still need to decide whether I'll build the avionics units with 7 Segment displays or go the route of doing a faceplate mask over an LCD monitor. But, knowing I have a possible 7 Segment solution within reach gives me one more factor in my decision process.

    Again, Thanks!
    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

  5. #5
    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: Can Link2FS & Arduino do this . . . ????

    Good stuff Tom ,,, I was a bit worried that you may have been expecting a "super fix" for everything but if all you want is to drive 7 segment LEDs then it's a piece of cake ,,, especially the "serial" driven ones that require very little code on the Arduino and only use a couple of pins.

    OK ,, happy researching Tom ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  6. #6
    New Member
    Join Date
    Nov 2012
    Location
    Sydney Aust
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can Link2FS & Arduino do this . . . ????

    Hi All,

    Firstly, thank you to Jim for supplying all this information and getting lots of people going with Arduino and his fantastic programs.
    I tackled the display issues with some experimentation with LCD screens, but after much research stumbled upon a site called DealExtreme - Cool Gadgets at the Right Price - DX Free Shipping Worldwide (deal extream). Here they have Arduino compatible products extreamily cheap. Arduinio Mega is about $120 here (Australia) - I bought a Mega for $17 including postage!

    Anyway ... they have dual 4x serial segment displays. Extreamily easy to get going, and with minimal code.
    Here is what I have done so far:

    Attachment 7226 each board can drive 8x 7 segment displays.

    Attachment 7227 Only needs 3 pins from an Arduinio, and you can drive up to 8 of these 8x7 segment displays with only 3 pins!

    Attachment 7228 Here is the COM1 Radio frequency and standby frequency display for my radios. The first 8 digits (from the left) is being driven by one board, the last 3 digits are being driven by a 2nd board (connected to the first board with +5v, Gnd and the same three pins from the Arduino).

    This means I can display the entire radio stack frequencies with only 3 pins from the arduino! I am going to use another set of pins to drive the entire set of displays for my auto pilot. The best thing is, these boards are $5 from DX.com including postage!!

    Here is the sketch I'm mucking around with ... it's taken from Jims examples, and uses link2FS_inout program (Thanks Jim!).

    //We always have to include the library
    #include "LedControl.h"

    /*
    Now we need a LedControl to work with.
    ***** These pin numbers will probably not work with your hardware *****
    pin 12 is connected to the DataIn
    pin 11 is connected to the CLK
    pin 10 is connected to LOAD
    */

    LedControl lc=LedControl(12,11,10,2);
    int xx; //sets up a variable for the data
    int yy; //altitude
    String AP;
    int i;

    /* we always wait a bit between updates of the display */
    unsigned long delaytime=250;

    void setup() {
    /*
    The MAX72XX is in power-saving mode on startup,
    we have to do a wakeup call
    */
    lc.shutdown(0,false);
    lc.shutdown(1,false);
    /* Set the brightness to a medium values */
    lc.setIntensity(0,;
    lc.setIntensity(1,;
    /* and clear the display */
    lc.clearDisplay(0);
    lc.clearDisplay(1);
    Serial.begin(115200); // sets up the baud rate for the serial coms.


    for(int i=0;i<8;i++)
    {
    lc.setDigit(0,i,8,false); // This does a quick test of all the segments
    lc.setDigit(1,i,8,false);
    delay(delaytime);
    }

    for(int i=8;i>0;i--)
    {
    lc.setChar(0,i,' ',false);
    lc.setChar(1,i,' ',false);
    delay(delaytime);
    }

    {lc.clearDisplay(0);
    lc.clearDisplay(1);}
    delay(delaytime);
    }


    void loop() {
    // scrollDigits();


    if (Serial.available() > 0) { //if there is a charator in the serial receive buffer then ,,,,
    xx = Serial.read(); // read it.


    if (xx == 'd'){ // Found Com 1 Radio Freq
    delay (11); // It seems to need a delay here
    //digitalWrite(13, HIGH);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,7,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,6,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,5,yy,true);
    delay (11);
    yy = char(Serial.read()); //DONT READ THE DOT
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,4,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,3,yy,false);
    yy = char(Serial.read()); //read last digit but dont display
    }


    if (xx == 'e'){ // Found Com 1 S/B Freq
    delay (11); // It seems to need a delay here
    //digitalWrite(13, HIGH);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(0,0,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,7,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,6,yy,true);
    delay (11);
    yy = char(Serial.read()); //DONT READ THE DOT
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,5,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,4,yy,false);
    yy = char(Serial.read()); //read last digit but dont display
    }

    if (xx == 'p'){ // Found AP Altitude set
    delay (11); // It seems to need a delay here
    //digitalWrite(13, HIGH);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,3,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,2,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,1,yy,false);
    delay (11);
    yy = char(Serial.read()); //Read the first charactor sent
    lc.setChar(1,0,yy,false);
    delay (11);
    }


    }}
    -----------------------------------------------------------------------
    Driving the displays is really easy

    lc.setChar(a,b,c,d);

    a = select board 0 -7 [You can drive up to 8 of these board on three arudino pins]
    b = select segment display position 0 - 7 [there are 8 7segment display per board]
    c = data to display [0-9]
    d = true = display "." false = no decimal point
    Thats it!

  7. Thanks Tom_G_2010 thanked for this post
  8. #7
    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: Can Link2FS & Arduino do this . . . ????

    That looks great! And, something I think I will have to pursue for my sim project! I am looking for space in the budget to purchase teh card and hope to start on it perhaps next month. Again, thanks all for the input, info, and ideas!!!


    Of course, since then I have come up with a couple more interesting ideas and I am wondering if there might be a solution via the Arduino route.

    STALL WARNING HORN
    I want to enable a stall warning horn that is mounted in the proper location in my cockpit. (Cessna 172 so in the wing root mounting plate next to the outside air vent on the pilots side) I would prefer not to hear the stall warning coming over the sim pit speakers but I don't think I can prevent that. However er I do want to have it clearly heard from the normal mounting location.

    Can I pick up an indication of the Stall Warning, better yet the intensity of it, in order to control a variable voltage output form the card which will drive an electronic stall horn?

    OUTSIDE AIR TEMP
    I managed to snag a Cessna logo'd dial type outside air temp thermometer on e-bay. It mounts in the end of one of the pull out wing root air vents. I will be hacking into the back of it to attach it to a small servo motor. I am hoping to get the outside air temp value from either FSX or from my weather software (AS2012 at this time but may be switching to Opus) to drive that servo motor and display the air temp on the thermometer face.

    So, a slightly different flavor of the same basic question: Can I pick up an indication of the outside air temp in order to control a servo motor via the Arduino card?

    If I get pointed in the right direction and can figure this out maybe I can return the good will and post some sketches myself in the future...

    Again, Thanks for the help and direction thus far I am hoping to get a lot of mileage out of it.
    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

  9. #8
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can Link2FS & Arduino do this . . . ????

    A couple of ideas come to mind. You could use a Piezo Buzzer to generate your warning. It's simple to do with an Arduino. The (-) lead goes to ground and the (+) lead goes to a pin on the Arduino. You can then use the tone() and noTone() functions to the turn the buzzer on and off. The drawback is that you can change the pitch but not the volume of the buzzer.

    http://www.adafruit.com/products/160

    The second idea is more complicted. Record (or get a recording) of the actual 172 stall warning. If necessary, convert the recording to WAV format. Play the recording back using an Arduino WAV Shield.

    http://www.ladyada.net/make/waveshield

    Another option would be to attach a digital-to-analog (DAC) converter and use that to drive a small audio amplifier. This would require some programming effort but might be the way to go.

    https://www.adafruit.com/products/935

    https://www.adafruit.com/products/987

  10. #9
    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: Can Link2FS & Arduino do this . . . ????

    Thanks for your post there Milobars. It's great to see projects getting posted.
    One thing tho ,, I'm not sure if it's just me or not but the attachment links don't work ,, I get ,,
    "Invalid Attachment specified. If you followed a valid link, please notify the administrator"
    Is anyone else seeing the attachments ????
    Once I can see them ,, I'll have a deeper study of your whole setup.


    Tom ,, Yes ,, I run a piezo for warnings and your right ,, it makes a big difference the sound coming from the actual panel rather than from the speakers.
    I did put a resistor in circuit with it ,,, cant remember why but it would have to do with the sound obviously. Maybe lowered the pitch / volume ?? cant remember I'm afraid.
    Although I didn't do it ,,, a bit of insulation tape over the piezo "hole" quietens it down considerably.
    There is actually a piezo in the "Uno 1" project on my site.

    Lets know if those attachments work please Guys or is at my end. ??

    Thanks guys ,,, Jim
    Last edited by Jim NZ; 11-05-2012 at 03:43 AM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  11. #10
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can Link2FS & Arduino do this . . . ????

    Quote Originally Posted by Jim NZ View Post
    Lets know if those attachments work please Guys or is at my end. ??
    The attachment links don't work for me either.

Page 1 of 5 12345 LastLast