Society of Robots - Robot Forum

General Misc => Misc => Topic started by: nihaddad on June 14, 2010, 12:11:49 PM

Title: C programming on Mac OS X 10!?!?
Post by: nihaddad on June 14, 2010, 12:11:49 PM
I want to write my robot's C programs on my MacBook Pro that runs Mac OS X 10. Should I be concerned with any compatibility issues down the line? Any issues with Compilation? And are their any recommended programs I should be using (like Text/Edit application which seems like Note Pad app on Windows)?

Title: Re: C programming on Mac OS X 10!?!?
Post by: GearMotion on June 14, 2010, 12:44:54 PM
The default OSX text editor is OK for plain text. Or you can try TextWrangler.

Are you writing OSX C code? Developing in Xcode?

Or are you cross compiling? For something like the AVR?
Title: Re: C programming on Mac OS X 10!?!?
Post by: nihaddad on June 14, 2010, 12:56:52 PM
Is one better than the other?
Title: Re: C programming on Mac OS X 10!?!?
Post by: GearMotion on June 14, 2010, 01:00:20 PM
Is one better than the other?

It certainly is.


Are you asking if TextWrangler is better than the editor that comes with OSX? My opinion would be yes.
Title: Re: C programming on Mac OS X 10!?!?
Post by: nihaddad on June 14, 2010, 01:02:11 PM
No is writiing osx c code developing in xcode better (easier, more efficient) than cross compiling for VAR?
Title: Re: C programming on Mac OS X 10!?!?
Post by: GearMotion on June 14, 2010, 01:08:29 PM
Writing code in xcode gets you an app/application that runs on the MacBook. You can write c code that compiles to be an app that does things ON your MacBook, within OSX.

Cross-compiling gets you code that runs on something else. A development board or similar is what runs the cross-compiled code. A PIC microcontroller or an AVR microcontroller are examples of the target device for which you cross compile. The PIC or AVR runs that compiled c code. You control things attached to that microcontroller, such as LEDs, motors, etc.
Title: Re: C programming on Mac OS X 10!?!?
Post by: nihaddad on June 14, 2010, 01:11:59 PM
Ah ic simple enough. I didn't know the term, but that's what I am interested in doing- cross-compiling a PIC microcontroller. Thanks.
Title: Re: C programming on Mac OS X 10!?!?
Post by: guncha on June 18, 2010, 02:27:30 AM
I haven't had any first hand experience with PICs, but from what I gather, it's not a very open platform (correct me if I'm wrong). And as such, you might run into problems like proprietary compilers not working/being buggy on OSX. I haven't had any trouble with AVRs though.

As for XCode, it's a very powerful tool with loads of features, but you don't need most of it for MCU code. Also setting up the build environment can be a bit of a pain in the ass. Any text editor with syntax highlighting will do just fine. TextWrangler is a good candidate.