Arduino Forum

Products => Arduino 101 => Topic started by: fiveStar on Jan 01, 2016, 10:27 pm

Title: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: fiveStar on Jan 01, 2016, 10:27 pm
I cannot get this to run. I changed the port in the Processing code to the port the 101 is using with no success. The preocessing sketch is unsuccessful.

Help
Title: Re: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: fiveStar on Jan 02, 2016, 06:01 pm
I read the Genuino post which did not help me (unfortunaty). My Arduino is on COM3 so I inserted a 3 in the "myPort = new Serial(this, Serial.list()[2], 9600);" where the 2 is. When I run the Processing sketch that line is highlighted and I get the message "ArrayIndexOutOfBoundsException:3". hat am I missing?
Title: Re: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: PllNrf on Jan 02, 2016, 08:51 pm

mine genuino101 is connected to the port com4 and after a few test runs with this setting:

myPort = new Serial(this, Serial.list()[1], 9600);


I did not understand why it works
Title: Re: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: fiveStar on Jan 03, 2016, 05:51 pm
The Arduino finally worked using 0 (zero) for the port number. Maybe that makes sense to someone, but not me.
Title: Re: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: fiveStar on Jan 03, 2016, 06:57 pm
I am really new to Processing. After reading about Serial I think I finally figured out what is going on (sort of). If you know the port that the Arduino (Genuino) is using put that port in parens in place of ""Serial.list()[3]". In my case the port is COM3 so substitute "COM3". I'm sure everyone else had figured this out, but not me the newbie.
Title: Re: Arduino/Genuino 101 CurieIMU Orientation Visualiser
Post by: fiveStar on Jan 03, 2016, 07:36 pm
After further investigation I found that if you run

 import processing.serial.*;

// The serial port
Serial myPort;       

// List all the available serial ports
printArray(Serial.list());

it wil  l return a number followed by a COM port
ie. 1   COM6

The number is what you enter between the square brackets in "myPort = new Serial(this, Serial.list()[2]," in this case instead of the 2. This works or the method from my previous post.