Created
July 5, 2012 00:51
-
-
Save RobotGrrl/3050343 to your computer and use it in GitHub Desktop.
When connecting Processing to an Arduino (or whatever serial port)... this can come in handy in case the ports get scrambled! Arrg!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int port = 0; | |
for (int i=0; i<Serial.list().length; i++) { | |
println(Serial.list()[i]); | |
if (Serial.list()[i].equals("/dev/tty.usbserial-A900F5IY")) { | |
println("ding!"); | |
port = i; | |
} | |
} | |
arduino = new Serial(this, Serial.list()[port], 9600); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment