Pages: [1]   Go Down
Author Topic: Detecting an arduino  (Read 1261 times)
0 Members and 1 Guest are viewing this topic.
Z
Australia
Offline Offline
Newbie
*
Karma: 2
Posts: 15
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a simple way to detect the presence of an arduino and which serial port it is connected to? If I export a sketch to an executable, the serial port is hard coded.

I thought about having the processing sketch send a message to every serial port and listen for a reply, but this doesnt seem particularly elegant.
Logged

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

The (virtual) serial ports that Arduino create on the PC are only present when the Arduino board is actually plugged in. So if you have no other serial ports, you should be able to tell the presence of an Arduino board by the presence of the serial port.
Logged

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

@Z
What platform? Mac Linux Windows? Version?
what programming language you want to use?
What is your goal?

problem seems to be solved for C#
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286854844/13
« Last Edit: January 19, 2011, 04:06:00 pm by robtillaart » Logged

Rob Tillaart

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

Z
Australia
Offline Offline
Newbie
*
Karma: 2
Posts: 15
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For reference: Windows (7)/Processing

I've constructed a program using processing which talks to the arduino, and Ideally I would export it as an executable that I could run on other computers besides my own.

The problem is that the total number of serial ports seems to vary in some manner im not aware of, and obviously the settings will vary if i use another computer.

I guess the question is, I am telling processing to look at a specific serial port in a sequence of serial ports (as in hey, look at the third port). Can I tell processing to look at a specific serial port instead (look at COM 7).
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 547
Posts: 45954
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can I tell processing to look at a specific serial port instead (look at COM 7).
You could. The "list of serial ports" that you are indexing now is just a collection of strings. You could hardcode the name, instead.

But, my Arduino is not connected to COM7. So, you should not rely on specific port names.

Mac names and linux names are completely different.
Logged

Pages: [1]   Go Up
Jump to: