Go Down

Topic: XCode <-> Arduino (Read 1 time) previous topic - next topic

mr_mario

Hello,
I still do not own the board, but my intention is
writing/reading Arduino data from a C++ (Carbon) program written
in XCode  on MAC OS X (Intel).
I suppose I need to use the serial communication, even if it's plugged into the USB.
Any suggestions, source code snippets?

Thanks

P.S.
Also, I have a more general doubt.... Once I dowloaded the program,
does the board loose it at power off?
Or does it remain written in its permanent memory?




MikMo

Yes you will have to use serial port communication. The USB port on the Arduino board shows up as a virtual serial port on yur PC (Mac).

Yes the Arduino board will remember the program even after being powercycled. Your data stored in variables will be gone though.

For code examples, sorry i'm a PC guy :-)

rockthecatzva82

MikMo,

Do you have any code snippets for a PC, Id like to write some C++ (using Dev-C++) but am not sure which library to use.  There are so many webpages showing different methods of serial communication that I am a bit confused.  Many of the programs that I have found are a bit too complex for my level of programming.  Right now I am considering using Python since it appears to be the simplest way to send/recieve data to the serial port.

Thanks!

camillemoussette

Hi,

you could check openFrameworks (http://openframeworks.cc/about). It's a nice collection of C++ libraries packaged together. The Xcode setup requires some steps to get it working, but it's well worth it. There is a serial class and it's quite easy to interface oF with Arduino:

http://openframeworks.cc/documentation#ofSerial-about

I hope it helps,

/Camille

MikMo

Sorry, no C or C++ code here.

My only experience with interfacing Arduino with a PC program was written in VB . net and is of no use in a C or C++ context.

MikMo
http://www.mikmo.dk

rockthecatzva82

Thanks for the tips, that open framework site looks great, will have to test later this afternoon.  Ive been experimenting with Python too, its a pretty cool language, was able to send bytes to my arduino using only 3 lines of code!  

Thanks again!

Go Up