PDA

View Full Version : Arduino COM / NAV LED display - FSX



JMeller
05-06-2011, 08:48 PM
Well...I have a success story. A small one, but a success story none-the-less.

I have completed the COM1 freq display (beta) by using (4) seven segment LED blocks and Charlie-plexing the anodes; therefore, I am only using only 11 outputs to drive the entire COM1 display (...add another output to drive the leading MHZ "1" and trailing KHZ "0" and decimal pt). I am also using (4) inputs to increase/decrease the MHZ/KHZ freq according to the B737 display. I estimate I will be able to use COM1&2 and NAV1&2 on a single 2560 bd using a 5ms loop for an undetectable flicker rate and little bleed to the unlit segments - leaving room to use the analog inputs if I need.

My problem will arise when I incorporate the rotary encoders; Since the loop will already be at 5ms, I believe I will need to use my second 2560 to handle the encoders and xmit data to the other 2560 "LED COM/NAV" display bd to prevent loop lag generated by the encoder read/translation.

I admit that I am a novice. If I am on the wrong track, please do hesitate to offer alternatives.

Jim NZ
05-07-2011, 05:49 AM
Hi James,,, Well done with the progress,,, neat stuff what you have acheived in such a short time and you will be looking forward to getting it to a usable state. Charlie-plexing ,,, very cunning approach.

Now the rotary encoder thingy ,,, As you know I like pulse switchs but at the end of the day everyone gets rotary encoders. I have (and still am) digging into this dreaded corner and there are 2 ways to interface rotary encoders into Arduinos.
1... Direct pin reading and sort it out internally or externally from there.(With or without an internal library)
2.. Use interupts and sort it out internally or externally.

Of the methods I have played with using the cheap mechanical rotary encoders, I found the following ,,,
Direct input was the most consistant performer using the BOUNCE libray, but it still had direction/pulse errors and wasnt that fast ,, although you could "build in" acceleration.

The interupt method was definately quicker but because of that, it really showed up dirty contacts with the wiping of the contacts in the switch, hence more direction/pulse errors. You can externally "debounce" the encoders contacts with capacitor/resistor arrangement but that puts you back to the speed of the direct read method,, more or less.

Optical encoders would really perform with the interupt method. (I think ,, but I dont have any)

Now,, That 5ms loop,, I wouldnt worry about it ,,, a "debounce" can be that long at anyrate so give it a go on the same card and see what happens.

If you have good quality encoders you could use iether method,,, but if you have the cheapies,,, use the direct read method with the "bounce" library.

I've been playing around with another method of handling rotary encoders and I'm Sooooo close to cracking it,, its frustrating. !!! A clean read with acceleration ,,, Soooo close. !!

I seem to be writing a book here,,, but I've passed on what I know.... Hopefully some-one else with more knowledge might pop in and help you James.

Again,, well done to get to where you are at ,,,, Jim

JMeller
05-07-2011, 09:10 AM
Thanks Jim for the kind words and insight.

Because I have a "new" set of eyes and have not developed (as of yet) a "set in stone" programming technique, I am going to toss this out there:
The code I have written has only one delay (5ms) and that is to prevent the loop from running TOO fast. It prevents the current from leaking over to the unlit LED segments. To debounce the inputs, code was written to recognize that when any input goes high, a variable is incremented +1 at the end of the loop. This variable continues to increment so long as the input is HIGH. When the variable == 20, the display changes accordingly. When the variable == 40, the variable is reset to 0 and cycle repeats. If at anytime the input goes LOW, the variable resets to 0 - waiting for any input to go HIGH to begin it's cycle again. This allows the loop to run as fast as it can while allowing the switch to settle into place - - and also increment the display in a readable/predictable manner if I continue to hold in the button. I don't know if this perspective from a novice is useful, but I thought I would throw it out there anyway. Of course, mods to the code will needed with rotary encoders since A or B can hold their state at the next detent.

As for the rotary encoders, I plan to purchase a moderately priced "grey code" encoder to reduce the aggravation of bouncing. Any recommendations are appreciated. I am also interested in the following post from Oleg (you probably have read this already) : http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino
However, I will need to get myself up to speed on truly understanding his code.

I am anxiously awaiting the day when you share you success with encoders!

Marching forward,
James

geneb
05-07-2011, 09:15 AM
Instead of eating one more output for the leading 1 and trailing 0, why not just tie them to Vcc and recover the input?

You might be better served in transmitting the freq up/dn commands to the host and let the COM1 Arduino pick up the change form the host instead of from another Arduino. (this is how I would do it, ymmv)

Switch contacts have been known to bounce for as long as 25ms. I didn't know about the BOUNCE library - I'll have to dig into that!

g.

JMeller
05-07-2011, 09:25 AM
Thanks Jim for the kind words and insight.
Gene, Vcc for the leading and trailing numbers - great catch; I'll do that.

Because I have a "new" set of eyes and have not developed (as of yet) a "set in stone" programming technique, I am going to toss this out there:
The code I have written has only one delay (5ms) and that is to prevent the loop from running TOO fast. It prevents the current from leaking over to the unlit LED segments. To debounce the inputs, code was written to recognize that when any input goes high, a variable is incremented +1 at the end of the loop. This variable continues to increment so long as the input is HIGH. When the variable == 20, the display changes accordingly. When the variable == 40, the variable is reset to 0 and cycle repeats. If at anytime the input goes LOW, the variable resets to 0 - waiting for any input to go HIGH to begin it's cycle again. This allows the loop to run as fast as it can while allowing the switch to settle into place - - and also increment the display in a readable/predictable manner if I continue to hold in the button. I don't know if this perspective from a novice is useful, but I thought I would throw it out there anyway. Of course, mods to the code will needed with rotary encoders since A or B can hold their state at the next detent.

As for the rotary encoders, I plan to purchase a moderately priced "grey code" encoder to reduce the aggravation of bouncing. Any recommendations are appreciated. I am also interested in the following post from Oleg (you probably have read this already) : http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino
However, I will need to get myself up to speed on truly understanding his code.

I am anxiously awaiting the day when you share you success with encoders!

Marching forward,
James

JMeller
05-08-2011, 03:12 PM
Another success story!!!! Rather than use a rotary ENCODER, I had a 12pos 2pole rotary SWITCH in my parts bin (available from your over-priced Radio-Shack). Although it takes one more input than a rotary ENCODER, it works very well. After verifing the basic code operation, I inserted the code into my COM / NAV LED display code - with a few modifications (reducing the loop cycle to 4ms and to read on the 2ms.) It works PERFECTLY! As a test, I turned the rotary 3X faster than I would in flight - no misses!

Jim,
Will you help you help to point me in the direction of how to create/modify the software to interface with FSX, i.e. LinkFS ???

If interested, I will post the code which can also be viewed by the Serial Monitor.

Pumped!
-James

Jim NZ
05-08-2011, 04:27 PM
Congradulations James ,, thrilled for you, and yes, the rotary switch is a good solid way to go.
The "in and out" of FSX,, I can knock you up a "one of" to suit what you are doing, no worries.
I've done heaps for other guys over the years (mainly motion platform stuff) although none of them were using Arduino's.
I want to get this bug out of my "keys" program first though.
In the meantime,, have a think of what info you want "out" and info back "in" to FSX ,,,, and its format.
Just think of a basic "get it going" interface at this stage as I have plans to do a full blown in/out program to suit what we do. (A user can choose what he wants out and what he wants in)

Of course we want code snippetts and pictures and anything you can produce that shares knowledge and helps other guys,, silly question ,, :) :) :)

Well done James ,,,,, Jim

JMeller
05-08-2011, 07:29 PM
The basic wiring on the 12pos rotary switch - (Black) loop the 1st, 4th, 7th, and 10th pin to "input 53"; (Yellow) Loop the 2nd, 5th, 8th, and 11th pin to "input 51"; (Red) loop the 3rd, 6th, 9th, and 12th pins to "input 49". Place the common poles to +Vcc (w/ resistor).

The basic code is as follows ( a smarter man can clean it up ):

int pin53 = 53;
int pin51 = 51;
int pin49 = 49;

int Black;
int Yellow;
int Red;

int BlackMEM;
int YellowMEM;
int RedMEM;
int BlackLOW;
int YellowLOW;
int RedLOW;

int LOOPcycle;
int Completed;


void setup()
{
pinMode(pin53, INPUT);
pinMode(pin51, INPUT);
pinMode(pin49, INPUT);

Serial.begin(9600);
LOOPcycle = 0;
Completed = 0;
BlackMEM;
YellowMEM = 0;
RedMEM = 0;
BlackLOW = 0;
YellowLOW = 0;
RedLOW = 0;
}

void loop()
{
Black = digitalRead(pin53);
Yellow = digitalRead(pin51);
Red = digitalRead(pin49);

/* ++++++++++++++++++++++++++ Memory Storage ++++++++++++++++++++++++++ */
if (Black == HIGH && LOOPcycle == 20)
{
BlackMEM = 1;
// Serial.println("Black is HIGH");

}

if (Black != HIGH && BlackMEM == 1 && LOOPcycle == 20)
{
BlackLOW = 1;
Completed = 0;
}

if (Yellow == HIGH && LOOPcycle == 20)
{
YellowMEM = 1;
// Serial.println("Yellow is HIGH");
}
if (Yellow == !HIGH && YellowMEM == 1 && LOOPcycle == 20)
{
YellowLOW = 1;
Completed = 0;
}

if (Red == HIGH && LOOPcycle == 20)
{
RedMEM = 1;
// Serial.println("Red is HIGH");
}
if (Red == !HIGH && RedMEM == 1 && LOOPcycle == 20)
{
RedLOW = 1;
Completed = 0;
}

/* ++++++++++++++++++++++++++ Determine Change ++++++++++++++++++++++++++ */

if (Black == HIGH && RedLOW == 1 && LOOPcycle == 30)
{
Serial.println ("+1");
RedMEM = 0;
RedLOW = 0;
Completed = 1;
}
if (Black == HIGH && YellowLOW == 1 && LOOPcycle == 30)
{
Serial.println ("-1");
YellowMEM = 0;
YellowLOW = 0;
Completed = 1;
}

if (Yellow == HIGH && BlackLOW == 1 && LOOPcycle == 30)
{
Serial.println ("+1");
BlackMEM = 0;
BlackLOW = 0;
Completed = 1;
}
if (Yellow == HIGH && RedLOW == 1 && LOOPcycle == 30)
{
Serial.println ("-1");
RedMEM = 0;
RedLOW = 0;
Completed = 1;
}

if (Red == HIGH && YellowLOW == 1 && LOOPcycle == 30)
{
Serial.println ("+1");
YellowMEM = 0;
YellowLOW = 0;
Completed = 1;
}
if (Red == HIGH && BlackLOW == 1 && LOOPcycle == 30)
{
Serial.println ("-1");
BlackMEM = 0;
BlackLOW = 0;
Completed = 1;
}

LOOPcycle = LOOPcycle + 1;

if (LOOPcycle == 40)
{
LOOPcycle = 0;
}

// if (Completed == 1)
// LOOPcycle = 0;
// Serial.println (LOOPcycle);
delay(0);

}



-James

JMeller
05-09-2011, 10:24 PM
Jim,
The basic vision for the COM / NAV LED display is to rotate the freq switch, arduino recogizes the change and sends a "C1 +" or "CC1 +", etc, command to FSX to increase the comm freq. When FSX changes the freq, it sends a command back to the arduino indicating the actual freq. After the arduino receives the value, it displays it on the on the 7-seg LEDs. This will allow the display and FSX to always be in sync.

I tweaked the code to run a little faster and found that if I turn the knob as fast I can, the code does not miss a beat. Therefore, I believe I will stick with a 12pos rotary switch as opposed to an encoder.

As for you programming the custom interface code - I appreciate that immensely! However, I am sure you are a busy guy. I don't want to bog you down - because after I complete each phase, I will be asking for more :) That being stated, I would be grateful if you would point me in the direction of how you built LinkFS... or I can pester you for updates --heheh. The Arduino has opened a whole realm of easy possibilities w/ FSX and my mind is racing!!

Jim NZ
05-10-2011, 06:07 AM
Hi James ,, Ive been away with work for a couple of days (can be a week sometimes) anyway ,,, thanks for posting your code ,, its things like that that help other people and for heavens sake ,,, dont worry if its "prettey" or not ,,,, It works and thats what counts. Any code can be improved on by some-one that is more "into it" than we are but thats the fun of it.

Great stuff on where you are at now ,, How are you sending the CC1 + to FSX and how are you getting the frequency back out of FSX ???. I am presuming thats where Link2fs comes in ???

On my site there is a program called "Link2fs_Testa" and I have supplied the source code as well, but its "visual basic 6" (not the ".net" one). Another way is to use VB or C# .net express edition (Free from Microsoft) and sort out via the FSX SDK what you want to do.(There are samples supplied)

As you get nearer your finished radio setup you could start thinking of a PDE file to suit a more logical sequence.
For instance ,,, you turn the knob ,,, you look at your LED's ,, you expect them to change as you turn the knob,, the actual indication showing in FSX is not really relevent in those split seconds. (There will be lag)

You need a trigger for the coms sequence ... Lets call them A=com1,, B=com2 and so on.

Turn the knob,, LED's change ,,, FSX changes.
What actually happens is ,,
Say your com1 radio is sitting on 123.45 ,, this figure is sitting in your Arduino as a string or some other form of data.
Turn the knob up one click ,, the string now is 123.46 and because the string has changed,, 123.46 is sent to your LED display routene and also "A123.46" is sent to FSX via some extra program.

As a back up to "on change" data ,, every 1 or 2 or 3 seconds the Arduino sends everything it knows ,, I.E. "A123.45 B122.33 C110.23 D112.67" etc etc. ,, all read from internal strings. (Or another form of storrage)
Thats how my in/out program will work at anyrate and you can see hints of it in Link2fs_Arduino_uno1's PDE file. (The send immediately and the backup every so often)

Simply speaking ,,, the radio/nav LEDs comes from the Arduino and NOT from FSX. !! although, I realize, at the moment you are stuck with inputing via keystrokes.... That will change though.

Roger on the rotary switchs,, I agree ,,, thats what I use here as well, although mine are as a homemade pulse switchs and like you ,,, they havent missed a beat.

geeze,, writing a book here again ,,,,, Cheers ,, Jim
ps this bug in my "keys" program is still a problem but I'll get it sorted,, it just takes time.

JMeller
05-10-2011, 10:55 PM
I took your advise Jim and I downloaded VB2010 - since VB6 has been scrubbed from the net. I opened your source code and contrasted it to what was inside SimConnect.

Visualize this, if you will -- Before seeing the VB side, I thought I would be passing V1; instead, I find myself performing a RTO!! That's intense coding language I cannot wrap my head around.

I guess I will to taxi back to the hangar and put my nose to the books for a few months. :)

Jim NZ
05-12-2011, 05:31 AM
Well James, welcome to programming ,, its a heck of a mess when you start,,, but when you know a wee bit ,,, well its just a bigger mess. !!!

If you are keen and dont know a thing ,,, for simconnect you might be better to learn C#.net rather than VB.net as there are lots of samples in the simconnect SDK in C# and only a few in VB.
(Check on that ,, I'm sure from memory its C# that there are heaps of samples for.)

I have some bits and peices that may help you,, download this ,,,

http://www.jimspage.co.nz/fsxfs9inouts.htm and have a wee look.

One of the things is a "starter" tutorial for C# by Brian Gefrich (a guru at gaming programming) he had started a basic toutorial but never finished it.

In the files ,,, extensions generally are,, for C# its cs and for VB its vb so you will be able to understand the different samples. (I havent a clue where I got the samples from ,,, possibly the SDK)

With your programming skills in the PDE file I am sure you will succeed in getting something going,, because basically you just want to "listen" for the frequencies from your Arduino. Piece of cake.

Happy experimenting James ,,, Remember ,, you cant "bust" it. ,,,, Jim

Jim NZ
05-15-2011, 04:38 AM
OK James ,, you've had a few days in the hanger now and you are probably ready for a bit of fresh air by now.!!!!

Can I ask a favor ???
Your thread is being watched by quite a few and it would be good if you could post some pictures (or diagrams) of your rotary switch setup. (or the whole setup )??

Thanks again for posting the code and the excellent description of your setup and I think a few pictures would indicate to other people that there ARE alternatives to rotary encoders and,, we both know they work very well. They look the same (a knob) and do the same job (move the frequency). I am how-ever still going to turn out something for the ones that insist on using rotary encoders with their Arduino but good solid performance is truely obtainable from rotary switchs.

And of course there are people watching and waiting on the out come of your radio stack ,, I should imagine quite a few builders would end up going that way too.

Keep at it James ,,, its all in the fun of it ,,,,, Jim.

wannabeaflyer
05-15-2011, 07:16 AM
Watching theses thread like a hawk my arduino should be here in the next n
few days really interested in seeing what can be done with this controller card .. Hi Jim it's been a while and i've been following your work since you got me hooked on motion cockpits years and years ago glad to see your still pushing the boundries and coming up with alternate ways to make this hobby accessable to the common man :-) great stuff as always cant wait to get to the servo Steam gauge applications for this card ,, bring it on . only regret i did not buy the starer kit version ( bread board, components, lnks wires ,sensors etc) so that i could have worked my way through the arduino tutorials but that can be fixed via another ebay transaction LOL :- busy reading and watching some great tutorial on youtube ... keep up the good work guys i lurk but build at the same time :-)

JMeller
05-15-2011, 11:34 AM
<smirking>
Hello Jim! Yeah, I have been hunkered down with my nose to the "books". When starting the VB side, I knew there would be a learning curve - but, my gosh! It gives me a true appreciation for what you and many others do to enhance our flight sim experience (for free!!). THANK YOU for all that you do!!

Below is my Radio Stack I built a little over year ago. Currently, the numbers are static. Fortunately, I had a little fore-thought and knew the day would come when I would actually control the display. Therefore, the transition will be easy with a few wiring mods. However, my original intentions were to use an array of TTL chips - until I found your page describing the success of the Arduino.
5158
Currently, the working display is residing on the breadboard. I just move the two common Anode pins to the appropriate outputs to switch from the MHZ display to the KHZ display and vice-versa. Since the display is Charlie-plexed, I, obviously, keep the seven-seg outputs where the are. I do not plan on making the display permanent until I get a handle on the VB / C# programming - I feel I may get distracted if I do. :)
5159


What I like most about the Arduino... It will replace the spaghetti below and the large footprint of space needed.
5160

As for my C# curve... I am having difficulty translating older documents (Brian's) written in .NET 2.x framework to the newer .NET 4.0 framework. There is lot of information out there. I had even located (3) C# SimConnect files that were actually written by a former Microsoft programmer - http://fsandm.wordpress.com/2009/12/
It will take some me some time to get up to speed. However, I know I will be better off in the long run for doing so.

I will post wiring diagrams in a few days. As for the copiled code, it may be a bit too lengthy for post. If it doesn't break any forum etiquette, I suppose I could.

-James

Jim NZ
05-16-2011, 05:53 AM
Kelvin !!! Well blow me down ,,,, Great to see you in this new wee "Den" we have here,, I got a feeling that there will be some great stuff come out of here especially when other developers come in and do their stuff too. !!!
Anyway ,, I better not chat here as people are following James radio unit and wont want to see me just chatting on his thread ,, Take care Kelvin and keep an eye out ,,, Jim

James ,,, neat stuff,, yes pictures really say a million words don't they ,,,, that's some setup you are making and ,,, YES ,, the spaghetti will be all gone !!! amazing really when you think about it. When you finally get there, it will be a nice feeling that "you done it all yourself" ,, and of course you get to use it in your sim.

Your code ,,, yes I think you are right ,, probably too long to post ,, I suppose if some-one wants to have a look-see they can private message you and go from there.

Now the dreaded area of simconnect programming ,, you are finding what I found ,,, the whole situation is not "stable" ,, too many versions of the VB/C# programming language and different .Net frameworks ,, well there's MORE ,,,, there are actually 3 different versions of simconnect !!!!
To an experienced programmer its a none event but to amateur programmers its just another thing to get your head around. Most of the above are backward/forward compatible admittedly but there are suttle differences and traps that the programmer needs to take into account if he is going to share his work.
All in all ,, its very frustrating ,, especially when we just want to do one thing but we need to learn a whole language and use a programming system that is far more complex than what we need.
Real good places for simconnect stuff are ,,,,
http://www.fsdeveloper.com/forum/forumdisplay.php?f=60
http://www.fsdeveloper.com/wiki/index.php?title=Category:SimConnect
http://forum.avsim.net/forum/255-ms-fsx-simconnect-forum/

No doubt you probably already found them, but there is some good info out there.
Thanks for that link to beatlesblog.simconnect ,, I hadn't seen that so I'll have a look see.

Hang in there though James ,,,, Jim

JMeller
05-16-2011, 08:03 PM
Well, here is the code and a quick overview of the wiring modeled towards new comers, like myself. I did not realize, until now, that I could upload more than a jpeg. I still don't know how to post an image and the link. Oh well, I'll get the hang of this forum stuff yet!

Anyhow, thanks again Jim for the links and support.
51635164

Returning back into the hangar,
James

Jim NZ
05-17-2011, 04:10 AM
Thanks for that James ,, and as far as uploading files go ,,, I didn't know that either !!!
Aaaahh you learn something new every day.

Heavens to Betsey ,,, that's some coding !!!! Excellent stuff and the diagram too ,,, a real good inside to what your up to and if some-one else wants to go down the same design ,,, its all there.
Thanks heaps James.

Don't stay in the hanger too long ,,,, it gets cold and dark in there.. LOL :) :)

Keep us updated with your progress James ,,, You seem to have your finger "well and truly" on the pulse. I can "smell" success in the wind.

Cheers ,,, Jim

JMeller
05-19-2011, 12:33 AM
In my haste to release the wiring diagram, I erred in the placement of the 10K resistors. They are pull-down resistors - not in series with rotary outputs. I also failed to include the 50 ohm resistor which is series into pole of the Rotary from Vcc - all reflected below. Oops!

5188

Kangaby
06-10-2011, 11:02 PM
One of the things is a "starter" tutorial for C# by Brian Gefrich (a guru at gaming programming) he had started a basic toutorial but never finished it. I was going to put it on my webpage but never had the pictures that went with it ,, Brian didnt iether but he was happy for me to share what I had.


Just to prove nothing ever really disapears from the web
http://web.archive.org/web/20080116215704/http://www.notasenator.com/blog/

Jim NZ
06-11-2011, 05:23 AM
Thanks for that Kangaby, I had tried to find the pictures etc but allas ,, I failed.
Anyway,, the whole lot of Brians stuff is there so thats even better ,,, marvelous.

Cheers ,,, Jim

Kangaby
06-26-2011, 08:44 AM
Another thing that might be worth thinking about is the Maxim MAX7221 chip, which is a serial input/output common-cathode display driver chip. I'ts capable of driving 8 seven segmment displays using the Arduino SPI bus. If you hardwire the first and last digit as suggested elsewhere, you can get the active / standby frequency display for a single radio off 1 chip.

These chips can also be cascaded together to give you extra displays. However, you need an external supply if you use more than 1 chip, as the Arduino can't supply the power on it's own via the USB. (So I've read)

I used a combination of the DateTime & LedControl library from the Arduino site to make a clock on a breadboard. It shouldn't be too hard to adapt it to driving some radio displays. LedControl and FSX (SimConnect) both use BCD.

You can also get 4 seven segment displays internally wired in a 12 pin package, which makes it even easier. I don't know if I can give out supplier names here, so if you google 7FR5643AS it will turn up the one I'm using. There are probably other suppliers, as well as similar displays (types / size). The display I'm using is a clock display, which just means it has a decimal point for each digit (as normal) plus the ":" between the 1st and 2nd pairs. There are other versions with out the ":".

JMeller
07-04-2011, 01:00 AM
The theory is a success!! After taking a 4-5 week hiatus (due to work & social activities), charlie-plexing two displays (8 anodes with no flicker) is possible w/ the Arduino. To update a previous post, I was not as forward thinking as I thought I was... I found that it would be more constructive & time efficient to build a new display to pair up with FSX Out rather than retrofit what I currently have. As a note to others which may be pondering the same trail I am on - I calculated ~14mA (360 ohms @ 5V) to the segments, but this will not be enough when Charlie-plexing; I am thinking 20mA-25mA should bring the luminosity up to a normal level.

5368

A shout out to Kangby - thank you for post(s). I perused Brian's site - I hope to use it after I work issues of my own. As for parts, I hope the autopilot display will be much easier since it is internally wired for charlie-plexing. Unfortunately, I was ****-bent on a .4" green display for NAV/COMM - no decimal point or assisted internal wiring :(

Jim,
As an FYI to the webmasters of this site - ie9 is not friendly at all to www.cockpit.org. I had to switch to to my wife's laptop to make this post.

Jim NZ
07-05-2011, 06:21 AM
Looking good James ,,, looking good ,,, progress. :)
Just while we're chatting about LED displays ,, can I throw in question ,,, is there anything available in the normal size LED range (like your doing James) that is "serial enabled" ,, ie it is driven with a serial signal. You can get them for the smaller LCD screens but I've never seen that for a bank of 6 digits like we need ???? It would be good if there was, as the mega card has all those serial pins on it and it would be real easy to do but I suppose the price starts to run away. :(
Just a thought, thinking you may have already researched that.

The problem with IE9 ,, can you fire something into the mycockpit support threads ,,,
http://www.mycockpit.org/forums/forumdisplay.php/81-MyCockpit-%C2%AE-Support
(Not sure if that link will work as there's funny conversions in it)
I'm a bit old fassioned here ,,, XP and firefox.

Keep at it James ,, no more "work & social activities" for you for now !!
Jim

mndless
07-05-2011, 07:47 AM
Jim... Not sure if this is what u r looking for, but sparkfun.com has a 7 segment display that is SPI bus and serial TTL ready.. Search for sku: COM-09767 on their site.... And only 4 digits.

Jim NZ
07-05-2011, 04:51 PM
Yea, I had seen them but looking for 6 digits (Auto pilot). ,, I just thought James might have already researched these.
I'm watching closely what he's doing here as it might suit an idea I have.

Jim

JMeller
07-06-2011, 01:02 AM
Actually guys, I didn't know there was such an animal out there. I did some "goolgle-ing" and all I could find was Sparkfun and some YouTube vids. If they used something other than .56", I would place the order today - it would be SOoo much easier. I am currently am using the .56" static display and it takes up too much real estate for my Arduino "vision" - hence, the switch to .4" 7-seg. Just as an fyi- for the autopilot display, I have purchased yellow 7-seg LEDs Part# LTC-4624JS and LED pushbuttons Part# 3FTL6 and cap Part# 1Q036; I have high expectations for that future project!

I am curious to know what other parts people are using that I am unaware of that would make design/soldering life easier. I did take a look at the fritzing website - cool stuff; Hope to dig into in the next few weeks. C#, Arduino, design & soldering, and NOW "fritzing" - so many things to learn and so little time!

I love this hobby :)

Jim NZ
07-06-2011, 06:06 AM
Yes it just gets deeper and deeper James and thats great !!! I love that too. !!

I've never been able to track down a true serial 6 digit display,, but there again,, I'd probably be put off by the price.
There is an 8 digit SPI unit,, which I supposes that one could unsolder the 2 digits not required ,,, SPI (Serial Peripheral Interface) is
a type of serial protocol that can be daisy chained (more than 1 display) and it can ??? be used direct from the earlier Arduino's but I dont know about the later ones. Most people use a shield for SPI from what I gather.

The following sell these things ,,, (All the same unit)
http://www.micro4you.com/store/8-digit-7-segment-led-with-spi-interface/prod_197.html
http://www.dfrobot.com/index.php?route=product/product&product_id=374
http://www.cooking-hacks.com/index.php/shop/robotics/spi-led-module-8-digital.html

Some info on them ,,, (NOTE ... the size of the digits seems to be a secret !!!!)
http://www.dfrobot.com/wiki/index.php?title=SPI_LED_Module_%28SKU:DFR0090%29

SPI info,,,,
http://arduino.cc/en/Reference/SPI

All in all James ,, for me in NZ it seems a can of worms for me to go down SPI as I cant get any of this stuff here but it would be interesting to find out how they go if some-one else has actually used them.
Another thing would be its speed of keeping up with the changes (in altitude) but it has the great advantage that you can use multipule displays just joined to one another and all from very few pins on the Arduino.

Just while we're on displays ,,, another thing that hit me was Davids long LCD display in this thread,,,,
http://www.mycockpit.org/forums/showthread.php/22792-Link2fs_FSXout_Beta-Anything-about-it.
which,, for me ,, could be a very good alternative for an Auto pilot ,, I'm still trying to find something like that over here in NZ to try.

Geeze,,,, I'm learning heaps from you guys ,,, great fun ,,, and very rewarding.

I'm sorry James ,,, you asked ,,,, and I write a book !!!! :) :)
Happy researching ,,,, Jim

P.S. I liked your choice of buttons and caps ,,, I just dream of being able to get that sort of stuff over here ... Nice stuff indeed.

cjellwood
07-06-2011, 07:18 AM
Yes it just gets deeper and deeper James and thats great !!! I love that too. !!


I wondered what the **** was going on here for a moment!

JMeller
07-06-2011, 11:54 PM
All in all James ,, for me in NZ it seems a can of worms for me to go down SPI as I cant get any of this stuff here but ...

Jim - I don't know the reasons/regulatons/ of NZ or if it is the added shipping costs- you would have to educate me. I did check one of my suppliers (Digi-Key--the one with the PB) and I verified shipment to NZ w/ $30 shipping fee ($10 here locally). If you shop like I do, I save up a large parts list before ordering so I can off-set the shipping charges. I don't want the "guru" to just dream !
Anyway, thanks for the links. I checked them out and they are very price friendly considering time, effort, and cost associated with parts I have already purchased. It has me pondering the use of red .56" LEDs...nah, I think I will stick with the tedious work for the (expected) results I want. As always, recommendations and tricks appreciated. As a matter of fact, while gather my parts list, I picked up a 2x40 LCD for $8 as a contingency plan :)

Jim NZ
07-07-2011, 05:13 AM
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 :)

JMeller
07-09-2011, 03:50 PM
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

JMeller
07-09-2011, 04:24 PM
Oh, and Jim.... I made an effortless mod to the code to display the altitude; that was cool!

Jim NZ
07-10-2011, 12:52 AM
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 ! :(

mndless
07-10-2011, 09:57 AM
Just for yuks, while on that point...take a look around lines 164 to 175 here (http://www.erj145.com/cgi-bin/erj/index.pl?n=mti2c). 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. ;)

JMeller
07-10-2011, 10:38 AM
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. :)

mndless
07-10-2011, 11:32 AM
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...

JMeller
07-10-2011, 12:00 PM
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!

mndless
07-10-2011, 12:16 PM
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!

venenoso
07-10-2011, 12:52 PM
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

JMeller
07-10-2011, 01:26 PM
Hello venenoso. If you are thinking of going down this route, you would first need this handy little program created by our forum leader: http://www.jimspage.co.nz (http://www.jimspage.co.nz/link2fs_fsxinout_beta3.zip)

Next would be this guide for your LED display (uses 15 outputs instead of 64 outputs to run comm1 and comm2) :
5385

Then, here is some ready to go code for Arduino (you may to change your pin assignments).
5386

Good Luck!
-James

Jim NZ
07-10-2011, 05:30 PM
Wow,, things are happening and happening quick !!!! I'm really frustrated that I dont have any 7 segament LED's to play with here.

The rotary encoder thing James ,,, yes I know your brilliant work-around that you are using but I never described what I meant very well.
The keys section just looks for a code,, ie "D150" and if you had an entry in the keys list it would trigger it to send to FSX what ever you had set it to.
So,,,,
Say in the keys section you had D150 sends a "NC1+" and D151 sends a "NC1-" to FSX, then all you need to do is ,,, once your PDE code has sorted out that the "encoder" is going (say) UP it then sends to the computer "D150" or if its going down, it sends "D151". etc etc
The actual pin 15 can be even one of the pins that is being used for you charlie plexing ,,, basicaly its a fake code.
In fact to keep it simple, probably use an odd-ball identifier ie "Dqw0" and "Dqw1" (The keys NEED the "D" as the first charator and it must be "0" or "1" as the last.)
Soooo,,, Yes ,,,, You can use your encoder thingy as input to FSX via the keys section.
I can see your smile from here :) :) :)

Venenoso ,, welcome to our wee world ,,, James is the man to give you a "knee's up" he's doing just what you want to know.

Cheers Guys ,,, Jim

EDIT,,,,,,,,,,
Geeze ,, I just re-read what I posted and it sounds messy.

James ,, do this to try ,,,,

In the "Keys" programming section,,
Pin No.,,, 95
key code,,, nc1+ (+ shows as a =)
SAVE
pin No. ,,, 96
Keycode,, nc1-
SAVE then EXIT

Now in your PDE code,,,,
When you determine the encoder is going up,, send D950 for each click.
When you determine the encoder is going down,, send D960 for each click.
The Mhz in com1 should go up or down as required.

Now that's a simpler way to describe it !!!!

venenoso
07-10-2011, 09:04 PM
Jim and James,
Thanks you both ,Jim I install your program in a win 7 - 64 bits machine and it don't run so made the exe compatible with xp sp3 and it is running ok , about the nav my brain works in "basic" mode only , I have all the ingredients and using opencockpits Little boards for 7 segment displays using 5 by board and looking it think it have the same pinout , I go firts with hardware and need to know what is in between , James do you connect direct the digits to the Arduino or go via resistor , and if resistor is needed let me know where between anodes or cc (segments), finally where you connect the anodes and where you connect the CC in the Arduino (pin N?)
Regards

Jim NZ
07-11-2011, 06:22 AM
Hi Venenoso ,, yes it is are a bit of a battle using VB6 stuff in windows 7x64 but we will sort it out as things take shape. If I get some spare time one day I might look at an automatic installer ???? Spare time ???? I've forgotten what means :)

James will pop back and sort out your display ,,, this is his project thread and I dont even have any displays like that so I'm no help,, Sorry.
I think the CC stands for "common cathode" ????? ,,, Anyway James will know.

Keep us informed with your progress Venenoso.
Cheers ,,, Jim

JMeller
07-11-2011, 07:41 PM
Venenoso,
Good to see you again.
Let's start with what I think you have:
http://www.opencockpits.com/uploads/manual_displays_eng.pdf

Now let's reference your LED hardware to the Arduino PDE and serial comm from Link2FSinoutBeta3:
serial COM1 freq = 119.35 ...so,
MHZLED1 = 1
MHZLED2 = 1
MHZLED3 = 9
KHZLED1 = 3
KHZLED2 = 5
KHZLED3 (you will not use since your hardware is a 5 digit display)

Placement of the COM1 pins are what you define:
Common Anode "trigger" pins are noted in the PDE as C1block1 = ??, C1block2 =??, C1block3 = ??, and C1block4 = ??. You will need to add C1block5 since your hardware is pre-wired for a 5 digit charlieplexed display i.e, (1)19.35. And you will need to modify the back-end of the PDE; we will cross that bridge when you are ready. Also, I would recommend placing C1block "x" pins in sequential order i.e, 2, 3, 4, 5 etc. since the the back-end of the PDE steps "+1".

Cathode 7-segment pins are defined as COM1LEDa = ??, COM1LEDb = ??, etc.

Resistors - YES! For even illumination, use a minimum of 160 ohms (31mA @ 5V) and no more than 250 ohms at each cathode segment; the reason, the Charlieplexing of and LED display will diminish the illumination with increase frequency (lesson learned). Lesson learned, I will modify my display for 180ohms at each segment. Do not ever place a resistor at the Anode "trigger" for it will affect the illumination as more segments light.

Also, reading the opencockpits doc gave me an idea... controlling the illumination thru use of analog pins :)

This should get you started and I hope this will help to further your adventure.

-James

P.S.
I am glad you entered the forum. I realize that all of my meticulous design time and endless hours of soldering can be bought with 5euros a PCB! :(

JMeller
07-17-2011, 03:08 AM
Well, I completed the Comm1, Comm2, Nav1, and Nav2 display with satisfactory results. Lots and lots of soldering . . . 5406

Here are the results using FSX in/out . . . 5407

The serial read delay has been reduced to a minimum delay of (1) and cycle loop delay of (2) for a total of (3). I haven't tried it yet, but I hope there is enough loop time to debounce the rotary switch for freq control.

I spent a few hours trouble-shooting; I had my "0"s looking like "U"s. I eventually found that the solder flux was causing low resistance (80 ohms) from the A segment to the G segement. Plugged it back up, and found the last digit not working. I was cleaning and cleaning the tracks until I realized that since I am using a 14 pin header (instead of the needed 16pin header) I should plug in the added header for the last digit.... grrr - wasted time! All-in-all, I am satisfied with the results. I will need to use the the other MEGA (predicted) for the standby frequencies. I am anxious for the results of mndless's results of the master/slave config. In the meantime, I will press on with the stand-by freq bd.

-James

Jim NZ
07-17-2011, 04:09 AM
Neat stuff James ,,, Really cool ,,, It looks like its made to work. :) :) :)
There is something about the LED's that make it look "right" I gotto admitt. One day I'll get some and have a play myself,, till then,, I'm stuck with the wee LCD's that everyone seems to use with their Arduino.

Re. the serial delay ,,, I wouldnt loose any sleep over it as if the reads dont keep up with the incomming data "at the moment" it will still be in the buffer to be read when things slow down a bit. (We're talking an un-seen delay here) So you wont miss any data.

I had a wee chuckle over you antics with the soldering / empty pin boo-boo :) :) :) Happens to us all James .... of course you wont get any simpathy from any of us ,, we could give away very simular stories :) :) :)

Yes, what Tony's doing would really suit driving LED banks like you've done ,, it would free up lots of pins on the main board thats for sure.

Looks great James ,,, Thanks for the update ,,, Jim

JMeller
07-31-2011, 07:20 PM
Very excited! Finished & verified stand-by freq display board as operational. No pics since it is essentially the same as the active board- just offset a-bit. I am ordering more flat ribbon and header connectors since I will need more to complete the interconnect of the displays. My next step is "marry" the boards together via RS-232 comms ... any recommendations welcome. After that, buttons for Comm1, Comm2, Comm1 & Comm2, rotary switches/encoders (haven't decided on rotaries, yet) and finishing assembly!

Jim NZ
08-01-2011, 06:22 AM
Good stuff James ,,, I can see the grin on your face from here ,, it's always a good feeling when things come together as they should.

Talking of cables and plugs ,, I cant find where,, but some outfit sells an "adapter" (or joiner) to use on ordinary flat computer cables with plugs,, to enable them to plug straight into the Arduino. If your anything like me ,,, I have heaps of computer cables (the flat ones with a multipin sockets on the ends) but of course,, the Arduino has the same sort of "socket". The thing I am looking for just looks like a "header pin set" but the pins are long on both sides of the plastic. ???? Even what they are called would be a help. ??

Now the options of using multiple Arduino's ,,, there are heaps ,,,
Serial between cards ... (various modes) and (wired or radio)
Network between cards .... (wired or radio)
Just wait until "FSX_inOut_v2" comes out (it can drive 4 cards at once)

Like you ,,, I've never been down that road so we are both watching Tony's developments with interest.

Interesting you haven't decided on rotary encoders yet James ,, you've had the "taste" of doing it with ordinary rotary switches (and rightly so !!) and they DO work great. In the thread on rotary encoders I intend to go back one day and thrash out the different ways to achieve the same thing as a rotary encoder ,,,, there are always more than one way to skin a cat. !!! :) :) :) (To the purist ,,, no cats were harmed in making this post) :) :)

One thing that nags at me ,,, and you or Tony might be the first to strike it ,, is lag. At the moment the data "path is like this ,,,,,
TurnKnob > arduino > FSXinOut > Simconnect > Radio changes freq > Simconnect > FSXinOut >Arduino > LED
so even in a "one card" setup, there's lag ,,, its not ideal, although it works and it's bearable.

In an earlier post on your thread I spoke of the data being "held" within the Arduino and basically the "end result" of a change going back to FSX ,,, a data path, something like this ,,,
Turn Knob > Arduino > LED > FSXinOut > Simconnect > Radio changes freq.
Far quicker and it would be more or less instantaneous from the rotary encoder to the LED on your built radio.
Food for thought ,, hopefully I'm wrong ,, but if it does happen then all is not lost. Its just a matter of putting radios and whatever else, thru a different "direct in" page in my software.

Anyway ,,, Congrats on getting it going James ,,,, Jim

JMeller
08-02-2011, 11:11 PM
Well, I learned yet another thing today... My display had the "unused" segments ever-so slightly dimly lit. I chalked this up due to flicker speed bleed and accepted it. UNTIL I noticed the top-most anode blocks did not reflect the same characteristics. I then moved the connectors to the second set - same results. Then to the next card- same results. It was at that point I was annoyed with the dimly lit segments because now I knew something was amiss. To help pin-point the problem, I had slowed down the loop cycle; this test revealed my FSX received digits were off by one anode. (I guess the speed of the loop cycle masked the problem.) Perplexed, I combed through the PDE and found that I assigned the new FSX received number before switching off the old anode. To correct this, I turned off all of the anodes at the top of the pde loop. Uploaded the file - WOW! Now the numbers are crisp and bright!

Jim-
Long header pins - Yeah, I know what you are talking about (used them on my LCD). I snagged some from a replacement daughter card at work since all I needed was the card ...pins were already in place. My current Nav/Com interface has the standard double header on a PCB with the pins nearly equal length on both sides. I heated up the pins to move the plastic prior to soldering. After soldering the pins in place, I pryed the plastic off - giving equal pin length on both sides of the PCB.

Rotary encoders - I haven't had time to play with them yet....too busy sniffing solder smoke :) As you may be able to tell, I have been doing a fair share. The displays are not lit up because... well, I have enough 10 conductor flat ribbon; just no 10 pin header sockets. And, I have enough 14pin header sockets; just not enough 14 conductor flat ribbon - LOL. Poor planning on my part!

5510

JMeller
08-12-2011, 11:14 PM
This was a test using the Arduino NAV/COM LED display as an Altimeter using LinkFS IN/OUT :

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

enjoy.

Jim NZ
08-13-2011, 08:01 PM
Well done James ,, runs smooth and quickly. Very nice.
The tricky part of the mission seems to be over (getting the LED's to work) and now there's going to be no holding you back. :) :)
Do I spot you have a built cockpit there ????

Well done James ,,, Jim

JMeller
08-13-2011, 08:53 PM
I need atleast 30 partners to get the NAV/COM LED display to an affordable level for everyone to enjoy. I will not make a profit- not a dime - from the design board. If JimNZ can do it for free, I willl also. Below is a vid link to the the design board. In order to make this a affordable to all, i will need to 30+ partners to make this happen. Shipping not included. The venture will not start until cash is "in-hand." and 30+ partners are involved. All in favor say "AYE".

http://www.youtube.com/watch?v=yFA_H-Jfh54

Jim NZ
08-14-2011, 05:23 PM
Wow,, that's a good thought James ,,, It's nice to see people thinking of other builders as things come together.

Thanks for the offer, but I wont be a starter (at this stage) as what your building is not the direction I'm heading for now. In the future I'll probably kick myself but my pennys have to go where I need them now.

I guess,, unless some-one knows exactly how you are going to complete the rest of the radio set (final product) and what it looks like etc ,, they will hold back on ordering the first bit. ,,, Sort of a "catch 22" thing I suppose. Then they will see the final product and want the PCB !!!!

Thanks for the offer tho James and good luck with the mission ,,,, Jim

JMeller
08-14-2011, 07:37 PM
That's ok Jim. It was mainly directed towards those interested in the LED displays. I found this neat little program, PCB123, (again) to archive my board wiring. To have these boards made for one person would cost over $400 USD. Then, I began thinking if people like Venenoso and others were interested - we could "co-op" our resources and drive down the price to an acceptable level. But, no takers even after over a hundred hits:-( . Personally, I don't blame them... something about sending $$$ to a complete stranger with zero credibility - :lol: Oh well, I thought I would toss it out there.

As for a cockpit... nope. Just a camera REALLY close to the monitor.

Mike.Powell
08-14-2011, 08:15 PM
If you can keep your board size within 2.5" by 3.8", and do without solder mask and legends, you can get three, double sided boards made for $51 plus tax and shipping. This is the "miniboard service" through ExpressPCB using their free design software. I've used them several times for prototyping and always been pleased.

You can, of course, have boards of any size and number made by ExpressPCB with or without solder mask and legends, but for low cost, rapid turn around prototyping the "miniboard" is hard to beat. I used to make my own boards, but no longer.

mndless
08-14-2011, 09:40 PM
JM... not to complicate things... but making a pcb yourself is not that difficult... happy to help with a few if you want....

I just made one for a I2C network of boards.... cost around $10.00 for the pcb and the etchant solution.... just takes a little time to draw it out in cad....

here is the cad file...

http://www.erj145.com/images/arduino/pcb1.png

and the resulting copper clad pcb after running through the laser...

http://www.erj145.com/images/arduino/pcb1.jpg

You can buy the etching solution, with removes the remaining exposed copper at your local radio shack....

Not real happy with the first run, didn't leave enough copper at the pins... so I'm burning pcb number 2... but, much less expensive... happy to burn a test pcb or two for you if you want.... no worries... well... and ... no promises :)....


simple process... paint the copper side of the pcb with a couple layers of paint.... use the laser to burn off the areas you don't want copper to remain.... using the etchant solutions, you disolve the exposed copper... then, using paint remover, you remove the remaining paint to expose the copper below and you are left with a simple PCB.... can't do the real fine work, but for the simple stuff I need... works great....

JMeller
08-15-2011, 10:07 PM
Guys, thanks for the valuable input. The hours upon hours of compact design and soldering have driven me to find more productive methods for other people and my next venture - the autopilot. I know- I need to complete this one first; just trying to a little forward thinking.

Mike, I will definitely place your suggestion within arms reach. With regards to the autopilot, I am sure I could sell the remaining two boards at cost to interested individuals. By the way, you did great piece on the arduino - a nice read.

Tony, thanks again for the offer. I tried the Radio Shack etching 15-20yrs ago with less than satisfactory results. Of course, I didn't have (and still do not) have a laser to assist me <jealous>. Would your tool be able to stay within the confines of this pdf (this is the upper layer...not finalized) 5509 - -5"x3", or would I be better served to use Mike's recommendation? I am thinking the autopilot will be a much tighter design. Once I figure out the placement of my various Nav/Com buttons, I would like to contract your services to build the face plate.

Thanks again.
James

mndless
08-16-2011, 09:24 AM
Jim... having an issue with the link.... above..... happy to help

Jim NZ
08-16-2011, 04:40 PM
Yep,, the boys in the back room have all been alerted.
The link in post 50 is also dead. :(

One of them cant find their other slipper ,, Also some mutterings about spilling their coffee. :) :)

Jim


UPDATE ,,,, WOW,, fixed already :) :)
Thanks Guys ,, Jim

JMeller
08-16-2011, 07:15 PM
Either they fixed it or it was something I inadvertently done. Either way, I uploaded and tested both files. I checked earlier attachments and they worked fine... I am thinking that I am the root cause for the failure :)

mndless
08-16-2011, 09:07 PM
I am always the root cause of failure... wife and three daughters... open mouth... cause trouble... walk away... standard ops around here... :)

Is this a two sided pcb? red on one side black on the other? lots of pin groupings with no apparent connections... 10 on far right??? another central group on the center far left??

Just need to understand what we have and I'll burn one as a test.... got the laser running hot tonight on some new boxes

JMeller
08-17-2011, 08:21 PM
Sorry for the late reply, Tony.
Yes, it is a two sided board. Pay no attention to items in black; that is the silk screening. The 10 pins, on both left and right, are header pins for the flat ribbon cable. Attached is the bottom side. This should clear things up.

Can your stubby 'lil fingers now fit in your new boxes? :razz:

5516

JMeller
08-20-2011, 01:50 PM
EC11EBB24C03 dual rotary switch - Due to JimNZ's success of eliminating the lag associated w/ encoders, I have decided to venture down that road. I found that the dual encoder (ALPS) EC11EBB24C03 has been recommended by this site and a few others via Google. However, I am having extreme difficulty locating the exact knob to fit this rotary. Any ideas?

Jim NZ
08-21-2011, 03:35 AM
I hope some-one can actually help here as I would like to know too James.
A while ago I had a dig around in that department and it can be a can of worms getting the correct knobs that you want ,, and ,, having them actually fit the encoder. (So many different shaft sizes and shapes.)

At the end I decided that I would go with one of Leo Bodnars ones as at least the knobs were going to fit properly.
Leo's can also be PCB mounted or thru a panel so that was another plus.

Have a look at near the bottom of the page ,,,,

http://www.leobodnar.com/products/BU0836X/

Certainly not cheap but neither are expensive knobs that don't fit the encoder you bought them for.

I haven't bought any yet (I only need 1) so hopefully some-one will pop up and point us in the right direction.
As for normal encoders ,,, my ones from Sure Electronics arrived and are working great. :)

See ya ,,, Jim

JMeller
08-21-2011, 12:59 PM
Hey Jim. Thanks for the link! At face value, the price was much better than what I could find (and all will fit nicely). I was in the final stages of processing my order when I noticed the USD to British pound conversion impaled my hopes. Paying 60% more due to the worth of US dollar :x was a bit much. Back to searching. :(

-James

geneb
08-21-2011, 04:21 PM
I just had a thought that might help you guys out.

What if you used a normal rotary encoder with a push-button built into it? Turning it normally moves one range of numbers, but if you press in and turn, it would run the other set of numbers. Pushbutton encoders are really cheap too. Sparkfun sells this type for under $3 and they offer a knob for it as well. I've got a few of them and they're very nice.

A little tweak to the code on the Arduino would make this a snap.

g.

JMeller
08-21-2011, 05:05 PM
Gene, I like it - Thanks! I have been researching knobs all day; contemplating marrying two Collin type knobs together, but cannot find the right match nor a 3.5mm shaft (much less a flatted shaft). I think I will go with your idea.

Thanks again for the input.

-James

geneb
08-21-2011, 05:24 PM
You're quite welcome James.

Sparkfun also carries an illuminated encoder for under $3 that uses a transparent input shaft. It has a built in red/green LED. They also sell transparent knobs that fit them.

If nothing else, it would be fun to mask off a line on the knob then paint it flat black for a nice illuminated knob. :)

g.

mndless
08-21-2011, 09:17 PM
Sorry for the late reply, Tony.
Yes, it is a two sided board. Pay no attention to items in black; that is the silk screening. The 10 pins, on both left and right, are header pins for the flat ribbon cable. Attached is the bottom side. This should clear things up.

Can your stubby 'lil fingers now fit in your new boxes? :razz:

5516

Sorry... been out of pocket past few days... moving kids back into college.....

The new boxes are a maked improvement, yes... will post some pics soon....

I'll ruff out a cad file for your PCB shortly... just to make sure I'm clear on everything, before I burn it....

Had great luck with the last pcb I made (thursday last).... turned out very nice...

pics here (http://www.erj145.com/cgi-bin/erj/index.pl?n=pcb)

JMeller
09-19-2011, 11:42 PM
Jim/Tony,
Just a quick update - I haven't fallen asleep at the yoke. My schedule is beginning to wind down, bought some needed parts from my regular supplier to wrap up this project (minus rotaries from Gene's recommendation ->Sparkfun... I'm still looking at their cool inventory), and purchased some parts for future projects (maximizing parts I will use anyway and reducing shipping/unit costs). Unless a surprise work-related project pops up this weekend, I expect to achieve large strides. In the mean time, I have been making use of the little time available to apply my elementary trig skills designing an Arduino FMS LCD display --- Fun stuff!

Jim NZ
09-21-2011, 05:48 AM
I didn't think you would have James :) and roger on getting a "stockpile" of parts ,, well if your anything like me then the one part you NEED for the next mission, wont be in the "stock-pile of parts. !! :) :)

A friend of mine is going to be interested in how you get along with the FMC as that's what he wants,,,, He's not into Arduino's though but that may be his "triggering" point to get him into them.

Looks like we are all quite and busy on "missions" or work ,, sometimes there just isn't enough hours in the day.! ! !

Keep at it James ,,, Jim

mndless
09-21-2011, 09:54 PM
I have been making use of the little time available to apply my elementary trig skills designing an Arduino FMS LCD display

Looking forward to seeing what that is all about.. :D

JMeller
09-25-2011, 06:35 PM
Great success! Functionality proven. Next, cosmetic overlay. Thanks again to Jim and his FSX IN/OUT interface.

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

Jim NZ
09-26-2011, 03:14 AM
WOW ,, it all works James ,,, great stuff.
Its really going to look the part when the face panel is done ,,, all those LED's lit up and working.,, nice.

You've come a long way in such a short time and must be thrilled for yourself. !!!
Of course ,, I'm scared to ask what the next "mission" is after the face-plate :) :) :)

Well done James ,,, and thanks for the kudos ,,,
Catch ya ,,,, Jim
(Now ,, unplug everything,, and I'm off to Aussie)

mndless
09-26-2011, 05:38 PM
Very impressive James!!! lot of work went into that! great job!

webitman
10-01-2011, 09:53 AM
Hi James
First post as a newbie on this thread and i have been an avid reader of this thread some time now and realy exited with the outcome of your exellent work using the arduino, you and Jim seem to have a great parnership going on, i am no programmer just a GA builder looking for help with certain things "this being one", by the look of your photos you are producing this for a 737 mabe, could this be configured to work for a cessna 172 "Com1 Com2 Nav1 Nav2 radios" i know i need transponder and others but cant find anyone building them at the moment, are the 7seg single displays or have you found special ones for this project, would you be willing to share your code for this, i am hopeing to learn and understand the programming side of the arduino, can i use any arduino board to work the radios as i have the duemilanove.
Hope it all makes sense.

Paul

JMeller
10-01-2011, 09:27 PM
Hi Paul.
Thanks for the kind words - it has been a rewarding adventure. As for Jim & I, he's the leader of this movement and I am just a team player learning from his experience.

As for the display, I have it geared for the 737. However, to make it authentic to the Cessna, one would only need to change the color of the 7-seg LEDs to red. Jim's Link2FS In/Out software is the "brains" of the operation.

As for the Duemilanove, it only has 10 outputs to use. For the COM1active display, you will need 7 outputs (for the seven segments drivers) plus 4 outputs (for each common Anode of each digit of the COM1active) = 11 outputs. To add another display, let's say COM2standby, (you will use the existing 7 outputs from the COM1active seven segment drivers) add 4 more outputs for each common Anode of each digit of the COM2standby for a total of 15 outputs.

NOTE: 8 Anodes per set of seven segment drivers is the limit in order to prevent flicker.

Knowing what I know now, I would have used 4 dual LEDs. The display would look something like this -
|[not used] [1]| |[1] [9.]| [.1" space] |[3] [5]| |[0] [not used]| - I believe this would make readability easier.

Attached are some 7seg LED displays that I recommend for the Cessna (along w/ the PDE driving my ArduinoMEGA).
5632

I hope this is useful.
-James

mndless
10-01-2011, 09:33 PM
James... is there a link to which 7 segment LED's you are using??? sorry if I missed it....

JMeller
10-01-2011, 09:44 PM
James... is there a link to which 7 segment LED's you are using??? sorry if I missed it....

NAV/COMM - 67-1419-ND http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=+67-1419-ND&x=0&y=0

Autopilot - 160-1540-5-ND http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=us&keywords=160-1540-5-ND&x=0&y=0

webitman
10-03-2011, 08:18 AM
Hi James
Thank you for the "Nav-Com Docs" extreamly useful, it may also help me undersatand how the codeing works as I would like to try myself, also thanks for your explanation of my board I have now bought the MEGA and waiting for delivery, I have downloaded Jims Link2FS In/Out, managed to install on my machine but its not talking to FSX useing his Test_NAV_COM PDE cant get any readout on the display, just need to get my head around it.

James the 7Seg LED displays you recommended I can only find on Digikey.com but they want 15 for postage which will make them very expensive, are their others that could be used in place of these that might be found on eBay, i have quite a few single 7seg led displays but will go for the dual LEDs as you mention.

If i need any more help may i impose on you or anyone on these great threads as i dont want to hinder, you know what us newbies are like.

Paul

JMeller
10-04-2011, 07:31 PM
Paul,
Attached is a "3D" version of the PDE. I think this will help you to understand what is happening inside the Arduino. 5639
Also, here is link I found useful when starting out - http://www.ladyada.net/learn/arduino/
About the LinkFS not communicating, read Jim's directions line by line. I had similar problem but I reread the instructions and found that I missed a step.

The LED segments - you could use singles, but that is A LOT of extra work. To answer your question - yes, any will work.

-James

Oh, and don't worry about being a newbie - I'm in the same boat!

737NUT
10-05-2011, 08:15 PM
Quick question, Whats the difference between the 19.99 knock-off on ebay vs the 64.95 on Arduino's site?

mndless
10-05-2011, 10:13 PM
Quick question, Whats the difference between the 19.99 knock-off on ebay vs the 64.95 on Arduino's site?

Need a little more detail... Yes, there are some issues with the low cost ebay knock-offs... That being said, I have purchased arduino stuff via eBay..

Arduino is a concept, an approach, a system for making the programming of a micro controller simple... Arduino is not just the platform... There are many varied arduino boards with differing... Pros and cons.... I like the RBBB .. And the Jeenode, each of which are arduino... Just as the mega and UNO are arduino...

You can get quality arduino based hardware on ebay... As with all things, you have to know what u are buying...

To be safe, stick with sites like adafruit, jeelabs.org, moderndevice.com, big fan of the latter for n. America.. Jeelabs in Europe.. The RBBB and the jee node are my arduino boards of choice....

Back to your question.... There are good and problematic arduino on eBay... If u aren't sure, stick with the links noted above..

JMeller
10-05-2011, 11:18 PM
737NUT,
Just an FYI... I bought my MEGA from an Arduino authorized recommended site - Advanced Micro Circuits Corp for $40 each which was $20 cheaper than the official site.

webitman
10-06-2011, 04:42 AM
James
Thank you for the 3D version of the PDE, understanding some of the concept of what is happening, how do you remember all the coding commands it must be a headache, when i said i would love to learn the programming side i think i was kidding myself at my age the old grey matter is dimminishing and my short term memory is! mmm what was i saying? mabe i will find it hard but will give it ago.

I do agree that link is very useful, some great info there and very informative for the beginer, i shall be useing that site often.

will start searching ebay now for some good dual LEDs.

edit:
James this will save a lot of work, check this out and see what you think?

http://www.mycockpit.org/forums/showthread.php/20765-Cessna-172-Replica-Production?p=122801&viewfull=1#post122801

Paul

JMeller
10-06-2011, 09:57 PM
...check this out and see what you think?

I like it. Especially the lettering.
Food for thought - Jim sent me this link several posts ago: http://www.dfrobot.com/index.php?route=product/product&product_id=374
For $15, this is really affordable! And, without the aggravation of soldering components!

webitman
10-07-2011, 05:00 AM
James

It seems we have some great choices for our future projects, very affordable! until we add the postage as both items are from either side of the pond.

The ones i showed you i think are about 20 for the pair which would be perfect for my application, plus postage would be OK as its local to me.

But as you pointed out "Food for thought"

Paul

Jim NZ
10-08-2011, 11:01 PM
Hi James ,, Just a quick thanks for that "3D" view on the PDE ,,, excellent stuff James.

So far I've just had a quick look but it certainly spells out what is going on it the Arduino's brains and what will happen. Real good info for anyone following your footsteps.

Thanks again James ,,, Jim
P.S. ,, I'll have a beer for ya :)

JMeller
11-06-2011, 10:11 PM
I'm working at a snails pace, but progress is being made. I'm not satisfied w/ how the rectangular buttons needed the circle drilled out from the transparent overlay to allow button depth. I am also pondering the reprinting of the display mask because the lettering for the circular buttons was overtaken by the holes drilled in the transparent overlay. But that's ok - I'm not a mechanical design engineer with precision tools at my disposal. Thus, I'm allowed mistakes, right? :) I at least know what I will do in the future for the autopilot.

Notice something missing? Yup, the rotaries. I am limited to a 10" wide space in order to fit in my previous console. I wanted the pieces together before I made a decision. I am still undecided. To make it "feel" right, I may need to cut into some of the unused portions of the standby display board and re-route some traces which are being used. Or, build an entirely new console. Blah!

Decisions ... decisions.

5771
By the way, how do I post an visible JPEG image and not a link?

Jim NZ
11-08-2011, 04:53 AM
Well done James ,,, Looking good and ,, no, I didn't notice the "no encoders" in the first look-see ,, obvious after a second look though. :)

I particularly like the sign work around the LED's ,, gives it a good look.
Actually I'm a bit envious of every ones work here as doing the panels that "look right" has always been a weak point for me ,,, I tend to get them going and "one day" I'll get back and finish it ... never seem to though. :( :(

Pictures that are attached to a post can only be seen by people that are logged in. In my case I have a link to a picture that is at my site and even those people not signed in can see it. I think most other people use their own site or photo-bucket or the like, and that way everyone see's them.
(I think that's how it works ??? ) Don't know why tho ????

looking good James ,,, Jim

MadMaori
06-23-2012, 07:24 PM
Man this code is perfect for my home cockpit setup all except i stupidly bought common cath instead of anode LEDs and have no idea how to adjust the code accordingly, any hints mates?..

JMeller
06-24-2012, 10:17 AM
If you change all of the digital write HIGHs to LOW and the all of the digital write LOWs to HIGH, it should work w/ no problem. You just have to keep track! :)
-James

MadMaori
06-25-2012, 06:32 PM
If you change all of the digital write HIGHs to LOW and the all of the digital write LOWs to HIGH, it should work w/ no problem. You just have to keep track! :)
-James

Oh wicked, thnx so much bruv, been contemplating all week how to take these cathodes back to jaycar and make them believe it was them who gave me the wrong ones lol, now to apply what you said to this code, thnx again man been combing the net trying to find an answer all week lol's ....my other prob is im mainly only worried about the auto pilot panel and im trying to apply what this code does for the nav radios into just the altitude, Speed and Heading rotaries in the autopilot panel, i've bought myself 11 segments for that 3 for heading, 3 for speed and 5 for alt , looking at a charlie plexing pic here either you or jim put up, looks doable lol cept its all common anode again so am gonna try changing this code to suit cathode then try to change it to suit just Spd , Heading and Alt, and ill worry bout hav radios once i can actually fly the plane without having to bring up a partial cockpit pic in the main windows for more realism of course, wish me luck lols!


P.S was so happy someone answered me my grammar went out the window, apologies ....

Bartlomiej
11-23-2013, 06:27 AM
Hi there
I was looking for something like this for a long time
So I need Arduibo,one of those serial LED display,amd i'm pretty much set
or do I need a separate PDE file (write a new one) if I want to build MCP.

or maybe I can use the one from LINK2FSinOut

See I do not know a thing about programing and link2fsinout sens to be able to get data from ad-on planes from fs,where FsBUS had problem with that.

JMeller
11-24-2013, 06:31 PM
Hello.

I used an arduino Mega and standard seven segment LEDs - not serial LED displays. Although, I think it would be easier to use a serial LED displays and find (or write) a PDE file.

As for extracting info from FS and addon planes - JimNZ is probably one better suited to answer that question. I know it would have its limitations. If the add-on is manipulating data already contained in FS, I know it can do it; items outside of that realm, i don't think so.

If you're looking for info on standard seven segment LEDs (not serial) and a working pde, here is good link - http://www.mycockpit.org/forums/showthread.php?t=26959&page=4&p=144049#post144049

JM

Jim NZ
11-24-2013, 08:17 PM
Yes it would certainly be easier using serial LED displays rather than individual LED units.

You do need to make your own PDE/INO to suit what you are doing and what hardware your using although as more and more serial LED displays are used ,, hopefully more post's will pop up with code in them.

Have a look at Fess's project as he used them and maybe he will post his code ,,,
http://www.mycockpit.org/forums/showthread.php?t=27048

Now the thing about addon planes ,,, most addon planes work fine with my software as they are normally all setup for simconnect.
In the case of "high end" addon planes (normally expensive) some of them run their own systems for various things that some variables are not available thru simconnect.

The best thing to do is try my software (it's free) ,, if it extracts what you want, then fine ,,, if it don't, then it don't.

Cheers ,,, Jim

flyguy262
11-30-2013, 01:46 AM
Jim,

Just wondering -- do your tools work with Windows 8? I hate Windows 8, but unfortunately have it!

Thanks,

-Mike

Jim NZ
12-01-2013, 03:23 AM
Hi Mike ,, have a look at this thread ,,,,,
http://www.mycockpit.org/forums/showthread.php?t=27083&p=144369

Cheers ,, Jim