15

Is there a good reference on how to set up an Arduino programming environment with Xcode?

An ideal answer would be along the lines of, "Oh yes, there's an active project on Google Code, just download the .dmg, copy the ${Xcode magic config file} to ${somewhere in ~Library}, restart Xcode and select "New Arduino Project" from the File menu. Click Build with your Arduino plugged in and it uploads it direct to the hardware."

Google gives a couple of hits, but they're kind of vague and out-of-date (specifically, the way Xcode does project templates changed between Xcode 3 and 4 and I can't find an Xcode 4 template.) I've officially outgrown Processing and I'd prefer not to blight my home life with Eclipse if at all possible.

3
  • This question might be better suited for electronics.stackexchange.com Commented Dec 27, 2010 at 22:37
  • 2
    Also, you say that you've outgrown Processing. If that's the case, you're looking for AVR programming, not Arduino programming. Ladyada has a nice tutorial here, last updated two weeks ago. Commented Dec 27, 2010 at 22:38
  • 1
    I wasn't sure which of Electronics or StackOverflow was most appropriate. The Electronics guys have been helping me a lot with hardware questions, but this is purely software, so I thought here might be better. Can't tell if there's call for a "microcontrollers.stackexchange.com", I might poke around Area 51. As to AVR/Arduino, again it's kinda 50-50. I specifically want my environment to grok uploading builds to my Arduino hardware via USB, for which I'd guess you have to use non-"pure AVR" libs or support software. If you made this comment an answer I'd upvote :-) Commented Dec 28, 2010 at 3:38

4 Answers 4

5

You can actually use the arduino GUI to compile and upload, and set the editor to external in the preferences. That way, you can edit the C++ (PDE) files from xcode, and have arduino generate the actual CPP and build the whole shebang.

You can also use XCode to write plain C++/C for the arduino, using the avr-gcc compiler.

Have a look at: https://stackoverflow.com/a/8192762/153835

You can then use the plain avrdude upload tool to program the arduino. Have a look at: http://www.ladyada.net/library/arduino/bootloader.html

It used to be that the protocol spoken by Arduino was a modification of the STK500 protocol, and that only the avrdude bundled with arduino could speak it. I don't know if the mainstream avrdude was upgraded, or if you still have to resort to the avrdude inside the Arduino folder.

Sign up to request clarification or add additional context in comments.

Comments

2

I have just come across embedXcode which does exactly what I want.

Comments

2

Alternatively, if you are looking for a solution that is independent of XCode (or just another solution), check out CrossPack for AVR Development. Essentially, it is an AVR toolchain for OSX

This will allow you to develop outside of the Arduino IDE with C/C++. It is terminal line only.

https://www.obdev.at/products/crosspack/index-de.html

However, the instructable below gives steps for using it with the Eclipse IDE (well, the Eclipse IDE using it).

http://www.instructables.com/id/Setup-AVR-programming-on-OS-X-using-Eclipse/?ALLSTEPS

Comments

0

I also asked around on the Arduino forums and they're at the point where someone's posted a Makefile which works for me, but the templating system for Xcode4 is vastly different to Xcode3 and apparently still in some state of flux.

So as of May 2011 the answer I wanted to hear still doesn't exist but we're getting closer.

1 Comment

I've un-answered this as now I'm on Lion I specifically need an Xcode 4 solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.