I’m totally new to “C” and I’m a more than bit confused.
I see there are any number of scripts with the same name but either with the .c or .h extension in the example I downloaded to see what is going on.
I also looked in some of the scripts in the “donor” scripts and only found .h references (so far anyway).
What is going on there?
What is the CORRECT folder structure to be used for a project?
When I first created the sketch and saved it, it created 2 folders, “overview” and “data”.
What should be placed in these folders?
My project is named “afbot” and the script “afbot.ino” has almost a 1000 lines of comment about what I want to do and ideas on how I can possibly do it but it only has one un-commented command which is “#include <afbot.h>”.
Should “afbot.h” be in the same folder as the “afbot.ino” script and if not, where should I place these scripts and how do I make sure that the “#include <afbot.h>” command can find it?
In some languages there is a set of paths that the compiler will look in to find an included script.
Is C like that or would I have to modify the “#include <afbot.h>” line to get the compiler to the right script if it should be in a different folder/sub-folder?
I first got into programming in 1985 and bitter experience has taught me that if you do not do things as you should from day 1, sooner or later something is going to bite you in the butt and I do not want to make those sorts of mistakes when learning C.
Languages such as PHP allow you to create a “class” object so that you can store related information or commands in a structured and defined place.
You simply create a new instance of the class for each requirement.
I know that “normal” C can implement that sort of object orientated approach, can the flavor of C that will run on a DUE support that and if it does, is the overhead required to implement such objects much greater than doing it the “old fashioned way”?
The project is CNC related but I have 6 axis (so far but it is probably going to be 7) to work with so creating an axis object and creating a copy for each axis makes big sense to me instead of inline data and code to do what has to be done.
I have put a brief synopsis of the project in my profile if anyone is interested.
Thanks for reading my question and ANY good advice will be extremely welcome.