sparkfun / AD8232_Heart_Rate_Monitor

AD8232 Heart Rate Monitor
Other
178 stars 190 forks source link

port not found #18

Closed preksha02 closed 5 years ago

preksha02 commented 5 years ago

hello i am using a ad8232 interfacing with arduino uno. The output generated in serial monitor is fine but the when i tried it in processing, its not working. there is a error in 1 line i.e. myPort = new Serial(this, Serial.list()[2], 9600); According to the text i read, serial.list()[2], here 2 signifies the serial port, but when i write 2 it shows an error 'ArrayIndexOutOfBoundsException: 2' i dont know to to resolve it . Kindly help

bboyho commented 5 years ago

Hi,

I just saw your comment. The number of ports that show up depends on your computer. You will need to change the parameter inside Serial.list()[N] based on the enumerated COM ports on your computer. A list of available COM ports will appear in the lower portion of the sketch window. Remember that COM port selection begins at 0 so you would be counting each COM port from 0(in terms of programming not in mathematical terms) from left to right. In this case, the Arduino enumerated as COM38 when uploading so it should be in the 3rd element in the array. Therefore, you would change the value to 2. As a result, the example code would be listed as Serial.list()[2]. Typically your Arduino will appear as the highest COM number if it is the only device connected to your computer.

Available COM ports in Processing

If your computer is showing three COM ports above, it's possible that there is another process that is using the COM port (i.e. your Arduino Serial Monitor). Make sure to close out any windows that are utilizing the resource. Otherwise, try adjusting the COM ports in the array to 0 or 1. The error that you are seeing is common and usually means that you have COM ports associated with 0 and 1 in the Serial.list()[] array.