Pages: [1]   Go Down
Author Topic: C and C++ serial connection  (Read 942 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I'm trying to link my Arduino uno R3 to a c or c++ application by a serial connection on Linux Slackware. I can't find a functional example online.
Can anyone tell me where to find one example for c and one for c++?
I'm able to use python but i prefer c/c++ languages.

Thanks
« Last Edit: September 23, 2013, 05:10:10 am by rfringuello89 » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can't find a functional example online.
You didn't look hard enough, then.

http://playground.arduino.cc//Main/InterfacingWithSoftware has sections for Arduino + C, C++, etc. once you get past all the spam.

If one of those links doesn't do what you want, detail which one and the problems you have. Then, we can do something about the link.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I forget to say "without external libraries"!! But now I assume using libraries it's the best way and I'm going to try those examples!

Thank you!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well, I forget to say "without external libraries"!!
That's a different story. Native support for com ports is not a feature of C or C++.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok now I understand why I couldn't find anything LOL smiley-grin
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13742
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you can try to open the file with the device name e.g. "/dev/tty" . small chance but worth the try... (all disclaimers apply)
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried this morning with "cat /dev/ttyACM0" and it works.. But i wanted something more "professional"! Right now I'm experiencing problems trying to compile libserial on my Slackware64...
Logged

Pages: [1]   Go Up
Jump to: