Let's Make Robots!

Noob in need of help: Modifying code that runs on Arduino Pro Mini to run on Mega 1280

Hi guys,

amazing projects you have here, well since nobody wants to help me out on the arduino.cc forum I would like to ask you here....

How to modify the code that was meant to run on Arduino pro mini to run on Arduino mega 1280... Probably some input, output numbers should be changed, if i understand correctly...

The Arduino pro mini that is used: http://www.sparkfun.com/commerce/product_info.php?products_id=9218

Here is the project: http://radio-commande.com/international/triwiicopter-design/

Here is the source code:  http://radio-commande.com/wp-content/uploads/2010/09/MultiWii1_3.zip 


Hope somebody helps me because i don't know if i can make this on my own, since i never programmed anything...

Thank you!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

If you have never programmed, this one is going to be a bit much to get your head around. The IDE will need to be added to with code to tell it what a 1280 is, how many pins it has and how to work with those pins --amongst many other things. This switch will require you to get into a lot of nuts-and-bolts of the chip which can be quite confusing. Not to mention, changing the actual bootloader on the chip with requires a programmer, software and a knowledge of lockbits and fuses etc. --Very complicated.

Now, I don't want to rain on your parade here but I think the wii/rc project might be a bit much to chew as well. Code is really not something that just goes in a works. You will need a basic idea of how code is put together to be able to change what needs to be changed to work with your particular project.

As always, it is suggested that you start with a simple blinking LED and go from there. Better yet, if you are curious to see exactly how complicated this is going to be, start with just the wii controler... You can write some code that simply takes the values coming from the wiimotion and positions servos to match. This will give you good experience with learning i2c communications, servos and overall structure of arduino code. This could be run on (I think) almost any arduino out there. When you get this simple test (with the wii and servos) up and running, you will quickly find out exactly how much will be needed in terms of getting something to fly.

BTW --If you are really stuck on getting arduino into a bigger chip, this might help.

Also BTW --Why do you want to use a 1280 anyway?

Sorry, I just looked it up --I had forgotten that arduino had come out with the 1280 board... It was "just being talked about" in the forums not too long ago.... What I said about "re-bootloading" the chip would not be needed so this would be a bit easier but everything else I said still stands.

...and I have to ask my question again, if this is going on something that flies, why would you want to switch to that HUGE 1280 board instead of the mini that must weigh just a few grams?

Well I would like to use the bigger one because I think it would be more extensible if I would try to add something to the design myself when i get acquainted with coding...And I get the Arduino mega 1280 at the same price as the pro mini + programming board...Talked to the developer of the code for this project and he says that probably 95% of the code would stay the same...that's why I wanted to try out changing the code..

I gotta tell ya, I think you are going to quickly find how big of a project this is when you start getting into this but hey, I have been wrong in the past. I do have to prepare you for how "asking for help" is going to go around here....

Just about the worst thing you can do around here is to A) ask a question that is easily found in the manuals and B) asking questions about something that is way ahead of where you are now. (asking about step 487 when you are on step 3). If you can avoid these things, you can fly under the radar around here and will do OK. If nothing else, you can get your parts, start coding and when you find out how hard this is going to be for a beginner, you can always use those same parts to start learning "sorta the proper way" and get a simple LED to blink. Trying to find the 5% of the code that does need to be changed within 95% that does not is going to be difficult without knowledge of code. No one is going to re-write your code for you unless you pay them so I'd start hitting the manuals --study a little each night whilst waiting for parts and you will have a good chunk down by the time they get here.

I wish you luck, and I really don't want you to get disapointed here.

Thanks for the nice advice...One more thing do you think that i should by the pro mini and go the plug and play way or i should buy the mega?

I would go with the mega or get one of the new uno's. This will serve as a good test-bed to learn on and you can run all of you eventual "flight code" on it (to test and work with, if the mega turns out to be too heavy). When you work up to actually coding to get something to fly, buying a mini will be a small investment in terms of the over-all cost of your airframe.

Be sure you know what is going on here... You are not starting a tri-copter project -it is much worse.... You are getting into electronics and programming in general. If, when you get going, you dig this stuff, you will find that there are 1000's of things you want to do with a microcontroller (on and off the ground). Get the basics down --it is a pain in the ass to learn the basic stuff but you gotta do it. Blinking LED and go from there.