A “BARE-BONES” STARTER PACK.
UPDATED 22 Aug 12
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.
You obviously need an Arduino card (Mega ,, Uno etc) any one will do as long as it’s the serial-via-USB type.
LET’S START ,,,,
Download the Arduino IDE ,,, Any version 0022 thru to 1+
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 PDE’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 and install Link2fs_inOut ,,,available here ,,,,
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.
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 “starter1.pde” ,, 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 ,,
Get FSX or FS9 running ,, open “Link2fs_inOut” set it up for the required com port and which sim (FSX or FS9) and
on the (main) page and tick “I” “Gear position nose”.
Save that “profile” (If you changed it from FSX to FS9 or visa-versa, you will have to close Link2fs_inout and restart it.)
In Link2fs_inOut ,, 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
LED flashing is gear moving
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_inout’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 11 switches and the 6 LED’s will indicate gear movements and flap movements.
Have a study of the code using the Arduino IDE or use “WordPad”
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.
You will spot things that are just repetitive in the code (gear nose, gear left etc) so you should be able to plan your own “outputs” from flightsim with ease.
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 7 ,,, 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).
THE SOFTWARE ,,,,
Double click on the attached “starter2.pde” 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_inOut ,, tick the 3 gear boxes ,,, and the flaps box. As in ,,,,
Click “Save this profile”.
Connect to your card by hitting the connect button.
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 switch’s using the “Keys” section of Link2fs_inOut.
Obvious ones are ,,,,
G for the gear toggle
F5 for flaps up
F8 for flaps down
You can program any other keystroke you like that suits flight sim.
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” PDE as a starting point for your next project.
Study the code and get to understand how it works.
Download this PDE “starter pack” here ,,,
Install it somewhere on your computer in a separate folder.
It contains a copy of this web page and the 2 starter PDE’s required for the above 2 projects.
The PDE’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.
Link2fs_keys codes ,,,,
To make it easy ,, here are the “Keys” codes for a complete radio stack in FSX. (For most of them,, FS9 would be the same)
Looking at the codes ,,, I obviously divert FSX’s attention first. This keeps the steps in sequence.
Remember the conversions where ,,,
Control shows as a ^
Shift shows as a +
+ shows as a =
So for (say) "Control" ,,, you would hit control but it would show as a " ^" in the textbox.
Don’t blame me :) Its a windows thing.
Remember to only hit one key at a time when inputting into my "Keys" programs.
Complete Radio Stack keycodes.
NC1X for Com1 change-over
NC2X for Com2 change-over
CN1X for Nav1 change-over
CN2X for Nav2 change over
NC1- for Com1 - Mhz
NCC1- for Com1 - Khz
NC1= for Com1 + Mhz
NCC1= for Com1 + Khz
NC2- for Com2 - Mhz
NCC2- for Com2 - Khz
NC2= for Com2 + Mhz
NCC2= for Com2 + Khz
CN1- for Nav1 - Mhz
CNN1- for Nav1 - Khz
CN1= for Nav1 + Mhz
CNN1= for Nav1 + Khz
CN2- for Nav2 - Mhz
CNN2- for Nav2 - Khz
CN2= for Nav2 + Mhz
CNN2= for Nav2 + Khz
N^+A- for ADF digit 1 -
N^+A^+A- for ADF digit 2 -
N^+A^+A^+A- for ADF digit 3 -
N^+A^+A^+A^+A- for ADF digit 4 -
N^+A= for ADF digit 1 +
N^+A^+A= for ADF digit 2 +
N^+A^+A^+A= for ADF digit 3 +
N^+A^+A^+A^+A= for ADF digit 4 +
NT- for Transponder digit 1 -
NTT- for Transponder digit 2 -
NTTT- for Transponder digit 3 -
NTTTT- for Transponder digit 4 -
NT= for Transponder digit 1 +
NTT= for Transponder digit 2 +
NTTT= for Transponder digit 3 +
NTTTT= for Transponder digit 4 +
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 22-8-12 for Arduino’s new IDE v1