I've been thinking about this problem for a couple weeks, came up with several possible solutions, but none have worked, so I'm looking for suggestions, ideas, or a good general direction to start thinking along.
I wrote a rather large applet that does a couple different things; sometimes, but not always, it will be connecting to an arduino via an HC-06 bluetooth module (the code is exactly the same as using serial through USB) . Sometimes I will need to run the program without connecting to serial. If I use Serial.list() it doesn't choose the right port, if the port is not available, the program doesn't run at all.
I need a method that connects if the port is available, but just ignores it and runs the program if it is not. Is there a function I can use to check the port before initializing, that way if it's not there i can tell my program not to use any of the portions that require serial communication?
Thanks
-J