Go Down

Topic: Is it possible to interface with c++ on mac? (Read 759 times) previous topic - next topic

icilian_fenner

Dec 08, 2009, 07:05 pm Last Edit: Dec 08, 2009, 07:11 pm by icilian_fenner Reason: 1
If possible, i'd like to get my arduino's accelerometer data + magnetometer data to C++ on my macbook.  AFAIK, the libSerial library will be available to us mac users at some point, but I'm rather in need of the technology now.  

I'm more than willing to write up in Obj-C++, if that's the most viable option available to me, though that'd mean more work (in learning any Obj-C at all, which is not something I've started on).  

I hope this isn't a redundant question, and I admit that I'm asking before extensive searching - my workload at the moment is quite high, and I'm simply having to ration my time too much to take a long look at it if I could pick some of you fine people's brains.   ;)

Many thanks

MOD: I realise that I can interface using Obj-C, so the question really is - would it be easier to learn enough Obj-C to write the whole thing in Obj-C++, or is there a pure C++ route that'd be easier to get given that I'm familiar with C++ already.  Hope I'm not wasting your time, peeps. ;)

PaulS

Objective C is not really that difficult. The way that methods are called is a little strange at first, but you can get used to that pretty quickly.

There are alternatives for forms, etc., such as the Qt library from TrollTech.com, but, for an Apple-style look and feel (and intuitive behavior), Objective C is the way to go.

icilian_fenner

thankyou very much :D It looks like this is the way for me.

npflood

Interfacing with Serial ports is actually rather trivial if you're using a framework. Cocoa is an excellent framework that encompasses both a "perfectly Apple" user interface as well as a TON of great system hooks that will get you going fast. I've found Objective C with Cocoa to be a very easy change from C++ especially if you have any additional Java (or other Object Oriented programming) background.

Serial Ports on the mac can be read and written like file IO, since OSX is *nix, all you really need to do is create a very basic protocol and implement it on the Arduino and your desktop app.


Go Up