Pages: [1]   Go Down
Author Topic: XCode <-> Arduino  (Read 1208 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?



Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :-)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Umeå, Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Think fast, live slow!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Pages: [1]   Go Up
Jump to: