multiwii arduino code, what to upload exactly

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
abouhaa
Posts: 4
Joined: Wed Jan 27, 2016 8:57 pm

multiwii arduino code, what to upload exactly

Post by abouhaa »

Hi there, I am fairly new to the multiwii. Just wondering, when I edit the config file and upload, am I only uploading the config file by itself? or am I uploading everything else in the multiwii file? like the GPs.h and sensors.h and sensores.cpp etc...

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: multiwii arduino code, what to upload exactly

Post by Kbev5709 »

Just set up in config.h and upload. It uploads everything it needs automatically.

abouhaa
Posts: 4
Joined: Wed Jan 27, 2016 8:57 pm

Re: multiwii arduino code, what to upload exactly

Post by abouhaa »

well ok another question, how come there is no setup or main loop section?

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: multiwii arduino code, what to upload exactly

Post by Kbev5709 »

Well, you better find somebody who actually writes this stuff instead of just using it for an answer to that. As far as I know the setup section is config.h. At least if you are talking about setup as it relates to setting up your craft it is. The last time I did any programming was 12 years ago in a community college class I took and have since forgotten. I am just glad it is easy enough for even an idiot like me to figure out.

On an only slightly more technical note, I WAS able to look up your question and it turns out that a program written in arduino has three sections, the VARIABLE DECLARATION SECTION Programs often begin with introductory comments that explain what the program is doing. These comments come before the variable declarations. It is a good idea to begin every program with comments like these so that when you return to your program later you’ll know what it does. Variables are usually declared at the beginning of a program immediately following the introductory comments. All of the variables that you are using in your code should be listed here, before the setup and loop sections.

SETUP SECTION. The setup section, which runs once when the program begins, follows the variable declaration section. Statements that lay the foundation for actions that happen later on in the program are put in the setup section. In particular, pinMode statements are almost always in this section. The section begins with the line void setup() {. Note that all statements in the setup section are placed between an open curly bracket ‘{‘ right after void setup() and a closed curly bracket ‘}’ at the end of the section.,

and the LOOP SECTION After the setup section runs, the loop section runs over and over until the device is turned off or reprogrammed—hence the word loop. The statements that carry out the main action of your program are in this section.
As with the setup section, statements in the loop section are placed between open and closed curly brackets. These curly brackets tell the computer when the loop section begins (with the opening curly bracket) and when it ends (with the closing curly bracket).
You will receive compile errors if either of the curly brackets is missing or if any statements are placed after the closing curly bracket or before the opening curly bracket.

That is what I found when doing a search on your question.
I suppose you could look for things in the code as described above and then come to a conclusion on what part is what.

abouhaa
Posts: 4
Joined: Wed Jan 27, 2016 8:57 pm

Re: multiwii arduino code, what to upload exactly

Post by abouhaa »

hmmm, you explained my question Sir, you didn't answer it. Arduino Code consists of exactly what you have mentioned in your previous reply, and that is my question... where did the void setup() section and the void loop() section go....
thanks

LutzB
Posts: 67
Joined: Sun Feb 08, 2015 4:01 pm
Location: Germany

Re: multiwii arduino code, what to upload exactly

Post by LutzB »

Both methods are in multiwii.cpp.

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: multiwii arduino code, what to upload exactly

Post by Kbev5709 »

abouhaa wrote:hmmm, you explained my question Sir, you didn't answer it. Arduino Code consists of exactly what you have mentioned in your previous reply, and that is my question... where did the void setup() section and the void loop() section go....
thanks

This question is off topic. Also, you could have opened up the files and found the answer yourself. I explained what you need to upload exactly which is what the topic question was. Next time start a new topic with a new question. I will make sure that I don't help when you do that.

abouhaa
Posts: 4
Joined: Wed Jan 27, 2016 8:57 pm

Re: multiwii arduino code, what to upload exactly

Post by abouhaa »

soooo unprofessional and aggressive. I didn't mean anything you just need to calm down. and btw i did read and search for my question before I looked for help here.. I don't need to know how to upload the codes I already uploaded everything a year ago and my quad is flying to hell right now, i was just curious (programming wise) if its possible to write a code without a setup and loop sections... sorry for any confusions i may have made, but u need to learn how to take chill pills...

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: multiwii arduino code, what to upload exactly

Post by Kbev5709 »

You are not special. I told someone else the same thing the other day. You are supposed to post a new question in a new topic. It's simple. It's forum etiquette. That way you get the help you need and you don't bother us un-professionals with questions you could answer yourself. I answered your original question. That's obviously more than I should have done. I don't claim to be professional so I have no qualms in telling you that you have no manners and definitely no clue. You are off to a good start here with 4 posts and you already have alienated one of those who could help you out. I refused to answer your second question because it was juvenile. If you already know that the part of the code you are asking about is needed to make the code work, and you know how to identify it, why the hell can't you simply look through the code until you recognize it? Too much work? That's what it looks like. Now I've had enough of this. Goodbye.

Cereal_Killer
Posts: 221
Joined: Fri Mar 06, 2015 5:44 am

Re: multiwii arduino code, what to upload exactly

Post by Cereal_Killer »

abouhaa wrote:i was just curious (programming wise) if its possible to write a code without a setup and loop sections


No, not possible. Even the most basic of code (e.g. monitor an input and turn a led on and/or printing to the serial monitor) requires both a setup and main (void) loop. That's just how computers work, by doing the same thing over and over again till you instruct them otherwise.

Post Reply