I have a mac a people keep telling me to follow the link in my second post and use xcode instead of the arduino ide.. is there a reason why i should do this?? whats the benefit?? thanks
That link only telly you how to use X code not why.
One quote says:-
demonstrate how to set up Xcode for programming the Arduino, however these didn't "just work" for me,
He says:-
I found myself getting frustrated by it's limited features
So I guess this is just a softie not liking to get his hands dirty.
If it's free then there's no reason to not try different things and use what works, don't use what doesn't work. The problem is that different people have different standards on what they consider a useful feature so you really have to try things first hand. Sometimes I like to just use a plain notepad and I'm not frustated at all with having zero features.
Don't get me wrong I love Xcode is is the best environment for developing desktop applications I have come across. But I don't think it is suited to an embedded situation. Take the instructions for opening up the serial monitor window:-
- Open /Applications/Utilities/Terminal.app
- The the command prompt in the new terminal window type (without the quote marks),
o "screen /dev/tty.usbserial"
o Hit the Tab key. The rest of the serial port's name should appear. If it doesn't, verify that the Arduino is plugged in via serial and is powered on.
o For example, the command for my Arduino looks like: "screen /dev/tty.usbserial-A4001Jdl"- Press return to execute the screen command. The Arduino will reset and should open the serial port.
- You can type to send characters, but there is no local echo (ie. you won't see the typed characters)
- To exit and close the serial port
o Press Control-A then 'k' to "kill" the window. This just stops the screen program and returns to the command prompt.
Well I think just hitting the monitor button is a lot easer and more convenient.
well, for me the main draw of using xcode would be code folding - it's a way to visually simplify the editor view by collapsing sections of code, so the user can easily/quickly scroll through multiple functions without being distracted by their contents. It makes editing complex sketches much simpler.
fyi - the link to the xcode template on that wiki page is broken & the version on the author's blog doesn't seem to work with Arduino 17 (even after implementing changes mentioned in the comments) - http://robertcarlsen.net/2009/02/28/using-arduino-in-xcode-532
I just use both at the same time. Turn on "External editor" in Arduino prefs. Make a new project in xcode, doesn't really matter what kind, because you won't ever compile it. Add all Arduino sketches to the xcode project. Change their type to be C++ code files.
To use it, open the sketch you want in Arduino and open the same sketch file in xcode out of your dummy project. Type in xcode, command tab to Arduino and compile and upload. Arduino will show you where your errors are, go back to xcode to find and fix them.
Use each for what they are best at. Xcode for editing, Arduino for compiling, uploading, testing. Not a perfect solution, but I sure enjoy it.
Well, xcode clearly has MANY more features than the arduino editor. If you're used to developing software usng Xcode, or Eclipse, or Emacs, or whatever, you're likely to somewhat frustrated by the primitive simplicity of the Arduino IDE. OTOH, none of those are set up to do the same things that the Arduino IDE does, so you have to go to some effort to upload code, or monitor the serial port, or select different boards. And if you're NOT experienced with Xcode/etc, then they're a more complicated environment to learn. The Arduino's primitive simplicity is a feature...
Besides, Arduino sketches tend to be relatively small, and some of the features of a more advanced IDE are less important for small programs.
I'm a vetern EMACS bigot, and I find myself using EMACS to edit sketches if I have complicated editing to do. Then I fire up the Arduio IDE on the same sketch for the compile/upload/debug part of the cycle... It's not a big deal.
Everything has its place, I think.
If I'm just playing around or testing a new shield or library or something else small the Arduino IDE is the thing I use.
If I'm working on a serious or large project -- the current design I'm working on for an Ethernet capable commercial alarm panel for fence systems has over 40 source & include files -- then its just too big for comfortably working in the Arduino IDE and I use UltraEdit Studio - by far the best programmer's editor and project manager I've ever used (and I've used a lot of them).
I work with two monitors so I have UE Studio open on one and the Arduino IDE configured to use an external editor on the second. I make changes to the source, save, and go over to the Arduino IDE to compile and upload.
Mostly I use the Arduino Mega for my projects and since it has multiple serial ports I always dedicate one of them (other than Serial) for debug IO. I simply stick a 6 pin header on the breadboard and use a FTDI USB cable. I use a separate terminal program to receive the debug output. I tie the VCC pin on the header to an input pin with a pull-down resistor to detect whether the cable is plugged in and debug messages should be output.
Which reminds me of a feature I'd like to see in the IDE -- some way to separately configure the port for the terminal and for AVRdude if a board with multiple serial ports is being used.
RoyK, I love your idea of automagically outputting debug info if something is plugged in to see them. Clever solution.