Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino programming on Mac OS X with Xcode 5?

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.

like image 732
Robert Atkins Avatar asked Dec 27 '10 16:12

Robert Atkins


People also ask

Can you program an Arduino on Mac?

To do this, open Safari on your Mac and just go to the website www.arduino.cc. Once you have opened the website, go to the software section and click on downloads from the dropdown menu. Now select the Mac OS X version, hit download and wait for the download to finish.


1 Answers

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.

like image 151
wesen Avatar answered Oct 01 '22 01:10

wesen