Jump to content

Recommended Posts

Posted

Hello,

 

I thought I would post this here in hopes of getting a little input. I plan to do what I should have done long ago: learn about C++ programming. My goal is to create a program for my hardware, the EpicUSB card that will allow input and output.

 

I am looking into online courses and may even return to school (but not for a degree). I have some basic and limited experience with programming over the years. I do enjoy learning and I'm just tossing ideas around at the moment. I think the ultimate would be to have a tutor that understands what is involved with simming. That would sure streamline things.

 

An overview of my program is to take it step by step with an initial goal to:

 

1. Connect and disconnect to my hardware.

2. Display a loaded profile name.

3. Have an unsigned variable for a 7 segment display.

 

A simple start, I have the code for above. I need advice about compilers. I believe I have a Dev(something) compiler on my other system. I would like to hear any thought of favored compilers anyone here may like. Free or pay (I know some of them get expensive).

 

As I want to keep it simple and step by step, I'll stop here. Apoligies if I seem to over-simplify or under-state. :)

 

I welcome any thoughts or advice.

Posted

*Warning* Programming languages pros and cons are subjective. Different people think differently and some are people are more suited to certain languages. These can be holy wars type threads. Also there is an aspect of right tool for the right job here.

 

C++ is not the best "first" language, and probably overkill for what you have described. C++ can write some tight code and you have access to all the low level graphics APIs, but there are many pitfalls and it's a hard language to master (note I said master not muddle along). There are no training wheels and you can get some nasty hidden bugs around pointers and memory management.

 

C# / .Net is a much easier language to get started with in my opinion. Most of the APIs are higher level and you can get right down to doing your task at hand with out a bunch of plumbing code for handling Windows internals. You do trade off having some lower level APIs, but 90% of them are not necessary for the work you are looking into. C# can easily call the other 10% and native dlls if necessary. The only exceptions to the above is if you are going to do some heavy rendering on your computer screens or doing code for primary flight controls (stick & throttle axis) where latency would be critical. The C# graphics pipeline in windows is CPU heavy. Helios 1.x uses it and I'm looking at alternatives.

 

You could also just do straight C if you don't need much UI. This gives you access to all the APIs except for the GUI frameworks by and large. You loose object orientation, but that may not be an issue with the small scale of the applications your talking about. Object Orientation comes in very nicely with GUI programming and making generic components (think an API which can talk to Epic, PHCC, etc..), but these may not apply to your use case scenario.

 

If you continue down C++ path:

1) Get, read and re-read "Effective C++" & "More Effective C++" by Scott Meyers

2) Avoid STL until you really understand C++ on your own first (then in my opinion forget it ever exists... compiler meta programming gives me nightmares about code maintenance)

3) Consider using managed C++ with .Net

 

C++ is a very powerful language once you master it, but I'd caution picking it up as a leisure activity. If you don't live and breath C++ you can get yourself into a world of bad code hurt quick.

Posted

If you are really just starting out, this website (http://www.cprogramming.com/tutorial/c++-tutorial.html) is a good reference and basic tutorials to get you on your way. I took courses in university for c++, but learning html, xml, php, c#, sql and vb I did by following similar guides. However, there is only so far these can go. I would suggest following some tutorials and then maybe investing in a good book on the subject, or library. The books used in university courses are usually available, and seeing how university (especially where I went) is chose your own adventure, you should be able to teach yourself. At least that is mostly how I learnt anything.

Posted (edited)
Hello,

 

I thought I would post this here in hopes of getting a little input. I plan to do what I should have done long ago: learn about C++ programming. My goal is to create a program for my hardware, the EpicUSB card that will allow input and output.

 

I am looking into online courses and may even return to school (but not for a degree). I have some basic and limited experience with programming over the years. I do enjoy learning and I'm just tossing ideas around at the moment. I think the ultimate would be to have a tutor that understands what is involved with simming. That would sure streamline things.

 

An overview of my program is to take it step by step with an initial goal to:

 

1. Connect and disconnect to my hardware.

2. Display a loaded profile name.

3. Have an unsigned variable for a 7 segment display.

 

A simple start, I have the code for above. I need advice about compilers. I believe I have a Dev(something) compiler on my other system. I would like to hear any thought of favored compilers anyone here may like. Free or pay (I know some of them get expensive).

 

As I want to keep it simple and step by step, I'll stop here. Apoligies if I seem to over-simplify or under-state. :)

 

I welcome any thoughts or advice.

 

Good day. To begin, I would recommend you try the compiler included in Visual Studio or use of the GNU GCC compiler. So I recommend to read the document ISO 14882. If you have questions, you can write to me in private. I apologize for my English.

Edited by eXceed

Welcome to the Rock

Posted (edited)

Thank you all very much. I thought twice about using C++ in the title and I will look into the options given. This will help me very much in choosing the classes I'll need to take.

 

I do note that the C++ tutorials I've been looking at contain code I recognize from working with the EpicUSB profiles I now use.

Edited by JG14_Smil
Posted

My advice is this: don't reinvent the wheel. Make sure you research thoroughly any and all available tools/libraries already out there. There are a lot of free open source libraries that talented people already developed that you can probably base your work on or integrate into it. Also, higher level "easier" languages does considerably cut development times - why do you think they are so popular? Its also a lot much easier debugging higher-level (interpreted or managed) code because of the safety features in languages like C# and Java. In my experience, slow development kills your inspiration, and porting code from one language to another, if there is a need for it, doesn't need to take that much work.

 

Just my two cents. Good luck with your project!

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Posted

Thanks, all. I take every bit of advice into consideration. I love the cprogramming.com website! I now have a simple plan of action to go with my enthusiasm and can get studying. I am old school with books, so I will look into finding the titles given.

  • 9 months later...
Posted

EPIC USB

 

Thanks, all. I take every bit of advice into consideration. I love the cprogramming.com website! I now have a simple plan of action to go with my enthusiasm and can get studying. I am old school with books, so I will look into finding the titles given.

 

Forgive me if I talk nonsense. Why can't we just use the options menu and go to controls. When I installed the driver only for my epic usb and plugged the usb cable into the computer, DCS A10-C will see 4 epic usb. I suppose those are separate channels to be used with epic expansion module to configure switches. Chime in on knowledge about this subject. Thanks GADROC for all the suppost.

Posted (edited)

My advice is learn C++ while you still think learning a programming language is interesting. Once you have learned one language there is the risk that you will get comfortable and not as motivated to start learning another language, and C/C++ is the only language without any limitations as to what you can do with it (almost, you'll need assembly to write some OS kernel code). When you know C++, you will have no trouble writing C# or Java code. If you've only learned Java or C#, you'll have trouble writing C++ code.

 

Among the people I have worked with and gone to school with, the only ones that are really good programmers are the ones that have learned a "real" language early on, like C/C++/Pascal. I have several theories as to why beginning with C/C++ makes a better programmer. One of them is that C/C++-compilers aren't often good at telling you what you have done wrong. While that is generally a bad thing, it forces you to develop a real understanding of the language. You can't just use trial and error, correcting the things the compiler tells you to correct, because the compiler error messages can't always be trusted. Another thing that makes C/C++ a good beginner language is that you'll develop an understanding of pointers and memory, and you're probably going to need it sooner or later. In fact, if you start programming for real you'll probably have to write some C/C++-code sooner or later, and that is where things are going really wrong for people that have only learned C# or Java. At the very least you'll have to interface C/C++-code some time, and it just get's so much easier if you know the language.

 

Another reason as to why C++ is the best language to learn is that you'll maybe want to go to other hardware sometime. C# and all of .Net are intended as Windows only. You may say that you'll never start using Linux at home anyway. And that may be true for your desktop computer, but what if you would want to buy a Raspberry Pi or a Beaglebone Black to do some home cockpit-project? Java could of course be used instead. But let's say then that you want to use a tiny microcontroller, then you're restricted to pure C in many cases.

 

To put it in a shorter way. If you want to start programming for real, I'd advise you to learn C/C++ first, beacuse chances are you'll never have the time or motivation to learn it if you learn another language first. If you know exactly what you want to do, and want to accomplish this project in the quickest way possible, chose whatever language is best suited for the task. In your particular case I'd suggest C#.

 

Edit: Didn't notice this thread was over one year old!

 

So, which road did you choose? :)

Edited by brydling

Digital-to-Synchro converter for interfacing real aircraft instruments - Thread

 

Check out my High Input Count Joystick Controller for cockpit builders, with support for 248 switches, 2 POV hats and 13 analog axes. Over 60 units sold. - B256A13

 

www.novelair.com - The world's most realistic flight simulators of the J35J Draken and the AJS37 Viggen.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...