A  “BARE-BONES” STARTER PACK.

                                                                      12 Dec 2013

 

A few people were having trouble bridging that first wee gap of the learning curve where it gets a bit confusing “just to start”.

Here is are step-by-step instructions that will have you extracting data from FSX or FS9 and actually making something useful for a “play”

The second “play” will indicate the movements of the flaps and the gear (via LED’s) and allow you to input just about anything you want via the “keys” program or by using “Direct Input” via simconnect in FSX or FSConnect in FS9 (FS2004).

You obviously need an Arduino card (Mega ,, Uno etc) any one will do as long as it’s the serial-via-USB type.

 

Included with this download there are 2 INO’s ,, they can be used in a Uno or a Mega.

The first one is minimal code ,,,, Multi_Starter1.ino  ,, no other hardware or wiring is required but it does do a demo of the gear up/down.

The second one is an intro into using multiple voids ,,, Multi_Starter2.ino ,, and it will do the gear and flaps and allow you to program switchs.

Voids are separate “area’s” for splitting off various extractions and other “happenings”.

The reason separate voids are so attractive is if you didn’t use them ,, your code would very quickly get messy and hard to modify or add to, also they are more efficient as well. 

The best thing to do after you have had a play with all the above, is to study the sample INO’s in this package and the one’s included with the “Multi” but most of all ,,,  READ the text file called  “Multipile Voids Learner.txt”

 

 

You-Tube tutorials ,,,

Eric William has done some marvellous You-Tube tutorials on all this so anyone wanting an overall picture of what happens have a look ,,,,

http://www.youtube.com/watch?v=OSzE6hgFWCM  

He has done many more so look into his list of video’s and find his other Arduino/FSX ones.

Thanks Eric

 

 

LET’S START ,,,,

Download the Arduino IDE ,,,

http://arduino.cc/en/Main/Software  

 

INSTALL THE ARDUINO IDE.

Read up on all the info on their site,,,

http://arduino.cc/en/Guide/Windows  (I’m assuming you are using windows)

Have a play with their demos and get to know the basic “In’s and out’s” of how their program loads INO’s (sketch’s) and what happens where.

There are a lot of demo’s within your installed Arduino IDE as well ,, look under “files / Examples”

Hook up a couple of switch and or LED’s and have a play.

Initially it’s a hell of a learning curve but once the penny drops it will be fun and rewarding.

 

LINKING TO FSX  or FS9( FS2004),,,,

If you haven’t already ,, download Link2fs_Multi_FSX or FS9 ,,,available here ,,,,

The FSX one ,,,  http://www.jimspage.co.nz/Link2fs_Multi.htm

Or ,,,

The FS9 one (FS2004) ,,,,  http://www.jimspage.co.nz/Link2fs_Multi_FS9.htm

Read all the documentation. There are a lot of notes ,,, but when you get really “into it” you’ll be happy that it’s all together in one place.

Get to know how it operates.

The same INO file (the software you load into the Arduino card)  can be used for both the FSX multi or the FS9 Multi.

Any reference (Doc’s or INO’s) to FSX can be read as FS9 (or visa versa) and any reference to Simconnect can be read as FSConnect (or visa versa)

 

OK ,,, NEXT STEP ,,,

So now you’ve got your finger on the pulse of the Arduino ,, it’s time to make something “useful” for flightsim.

Here’s the circuit of what you could build to start with ,,,,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Yes you are right ,,, there’s nothing to wire at all.  All you need is an Arduino card (Mega or Uno or whatever) and we are going to use the pre-wired LED in it that is wired to pin 13 to indicate the planes gear position.

 

Double click on the supplied file  “Multi_Starter1.ino” ,, the Arduino IDE will open containing that file ,, verify it and then upload it into the Arduino.

If the above don’t make sense ,, see ,,

http://www.jimspage.co.nz/how_to_pde.htm

Get FSX or FS9 running ,, open “Link2fs_Multi” (FSX or FS9) and set it up for the required com port.

NOTE: These pictures show as FS9 but it’s exactly the same for FSX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Then on the extractions1 page,  tick “<A  Gear position nose”.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Save that “profile” 

In Link2fs_Multi ,, CONNECT to the Arduino. You should see data going out to the Arduino.

On the Arduino you should see the data LED’s twinkling away as the landing gear is moved in your flight sim.

Now while you are raising or lowering the gear it will indicate via the inbuilt pin 13 LED on the Arduino.

LED off  = gear is up (Not down)

LED on is gear down.

Study the PDE and get to understand what is happening and how it works.

 

 

All done ,,,, Now let’s get more serious ,,,,

What  this “Starter2” does is introduce you to Link2fs_Multi’s system where you can extract or input just about anything you are probably going to need building a panel or a modest cockpit for FSX or FS9 (FS2004).

 

This “starter2” is meant as a demo to show you how to manipulate the data and develop something that you are planning on building.  The Arduino is super versatile but it can be a bit of a struggle to get to grips with a basic starting position.

This demo will let you input up to 9 switches and the 8 LED’s will indicate gear movements and flap movements.

Have a study of the code using the Arduino IDE or use “WordPad”.

This INO is really the demo “Multi_Keys_ Gearsimple_Simconnect.ino” (included  with the Multi) with every thing taken out of it that you don’t need for this demo.

Once you get to grips with what is going on ,,, study the other demos files included with the Multi and pick up the different ways to do other extractions etc..

There are lot’s and lot’s of explanatory notes within the code to help you. Explanatory notes start with // and have no affect on the code itself.

 

On with the next step ,, the circuit ,,,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


LET’S BUILD THE THING ,,,

Follow the above circuit and hook some LED’s to the board along with some switches.  You don’t have to fill the board with switches ,, a couple will get you going.

The important bits here are the LED’s ,,, they NEED to be into pins 2 thru to 9 ,,,  No-where else.

A reminder on LED’s ,, the long lead goes towards the Arduino and the short lead goes toward the negative rail (GND).

Switchs can be hooked to pins 10 to 19. (But not pin 13)

 

THE SOFTWARE ,,,,

Double click on the attached “Multi_starter2.ino” and the Arduino IDE should open and load it.

Check it compiles correctly

Upload it to your Arduino card.

 

LETS MAKE IT WORK ,,,

Start FSX (or FS9).

Start Link2fs_Multi ,, in Extractions(2) ,,, tick the “Gear Position” box ?Y ,,,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


and tick the “Flaps position” box <G  ,,  As in ,,,,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Connect to your card by hitting the “Connect button”.

Once you are connected to the Arduino card ,,, Click “Save all settings”. (For later ease)

Go fly and the LED’s should indicate if the flaps or gear are down or moving. (move the flaps or the gear just by using the keyboard at this stage.)

Once that’s confirmed ,,, program in some more switch’s using the “direct inputs” or “Keys” section of Link2fs_Multi.

The INO includes a core “inputs” void (inputs from your switch’s) and is set up for both “direct inputs” and also “Keys” ,,, to start with just use the direct inputs as the “Keys” bit is just there for any odd-ball stuff that there is no direct input for. Experiment !!!

Note: We don’t use Pin 13 for inputs as it has the LED on the board attached to it. (This can be overcome, but for now,, don’t use pin 13 as an input)

Have a play and a fiddle ,,, you cant break it  ,,, get to know how to program it in various ways.

You don’t have to have switchs connected to unused pins or LED’s to all the 8 Pins.

 

IT SHOULD RUN ,,,

If not then double check your every move.

Now it is running ,,, ponder where to from here ,,,  there are heaps of options and you can use this “demo” INO as a starting point for your next project.

Study the code and get to understand how it works.

 

Download this INO “starter pack” here ,,,

http://www.jimspage.co.nz/link2fs_multi_starter_pack.zip

Install it somewhere on your computer in a separate folder.

It contains a copy of this web page and the 2 starter INO’s required for the above 2 projects.

The INO’s have plenty of explanatory notes which “crowd” the code but at least every move is explained.

NOTE:  There are heaps of ways this code could have been written ,,, don’t think that this is necessary the best way but at least I’m sharing.

 

 

I hope it works out for you ,, good luck ,,, Jim

 

As usual with my stuff ,,,

Use at your own risk.

There is no support.

What worked for me may not work for you.

If it don’t work for you ,, then go and try something else.

 

 

Updated 12 Dec 13 (Starter1.INO was wrong)

Dated    10-Dec-2013

Flowchart: Alternate Process:  Back to the simulator main page.