Go Down

Topic: Practical Arduino logic analyser can't get going (Read 10187 times) previous topic - next topic

donone

Scarp the last result. I did not close the window of the IDE and restart it. I loaded from the menu into the old window and got the error.
Restarting cured that and I am now moving to the final error message which you predicted.
I needed to get this on post before you wasted time. I will now test the rest.

donone

Thank you PaulS for your assistance. The app does run and open a window and then I receive an 'arrayOutOfBoundsException:0' and assume that the error is due to some parameters i will need to set regarding port etc.??

I am not in a position to connect Arduino today and assume that it will work when I do.

I am extremely grateful for your time and trouble.

PaulS

I did not have the Arduino connected, either, and I did not get that error.

You mentioned that you modified some stuff. Can you post the modified code? If you changed the number of panes that should be shown, there may be a place, or more than one, where the program is still expecting 6 of something.

This is one of the reasons I harp on magic numbers so much. If the Processing sketch were well written, it would have something like
Code: [Select]
#define FRAMES 6
in it, so that you could change the number of frames in one place, and have it reflected everywhere.
The art of getting good answers lies in asking good questions.

donone

#33
Oct 23, 2010, 09:50 pm Last Edit: Oct 23, 2010, 09:53 pm by donone Reason: 1
I am afraid that the version I have used is the original unchanged SimpleSerialArduinoscope.pde.

It still contains the line that I changed in the file I modified a week or so ago to 4...
Oscilloscope[] scopes = new Oscilloscope[6];

The line highlighted by the error is...
 port = new Serial(this, Serial.list()[0], 115200);

In the message window there is a massive list of quesstions comments and answers, which I cannot copy and is too large to type, but it looks like something that might come up to help in the light of errors.

Most 'seems' irrelevant but the last piece does not...
ArrayOutOfBounds Exception: 0 at SimpleSerialArduinoscope.setup(SimpleSerialArduinoscope.java:110) at processing core.PApplet.handledraw(unknown source) That last section is repeated but with run instead of handledraw at Java.Lang.Thread.run(Thread.Java:619)
Needless to say it means nothing to me.

PaulS

Try commenting out the line
Code: [Select]
port = new Serial(this, Serial.list()[0], 115200);
along with any actual attempt to read serial data. It appears that, for you, you will actually have to have something attached to the serial port. I'm not sure why it works for me. I suspect that it is because I have something in the list returned by Serial.list(), and you do not. In my case, it is waiting for serial input from something that is not going to send it anything. In your case, there isn't anything in the list, so dereferencing the list fails, with the exception.
The art of getting good answers lies in asking good questions.

donone

#35
Oct 23, 2010, 10:01 pm Last Edit: Oct 23, 2010, 10:06 pm by donone Reason: 1
First, should I have something in this List and if so what and how? If not then fine...
Commented the line you suggested and then stopped on...
Port.Clear()
 port.bufferUntil(LINE_FEED);

Then success.
I guess that when I connect all will be well once I reinstate the lines commented.
Will it pick up the Port from List when I plug Arduino in or do I manually enter it in some way.

Then... Thank you very much indeed.

[EDIT] and I have now managed the channels and the screen height to match my Netbook small screen. Thanks again.

PaulS

Quote
First, should I have something in this List and if so what and how? If not then fine...

The list will contain a list of serial ports on your computer. If you have no serial devices (like the Arduino) connected, then the list might be empty. If you are running Windows, you can right click on the My Computer (or Computer) icon on the desktop or in the start menu, and select Manage.

On the dialog that is posted, select Device Manager. From the list that is displayed, find and expand Ports (COM & LPT). If there are no COM ports listed, the Serial.list() function will also return an empty list. If there are COM ports listed, the Serial.list() function should report the same ports.

Quote
I guess that when I connect all will be well once I reinstate the lines commented.

We can hope so.

Quote
Will it pick up the Port from List when I plug Arduino in or do I manually enter it in some way.

The Serial.list() function will return a list. Whether the Arduino is the first item in the list, or at some other position, is unknown. The command that you commented out assumes that the Arduino IS at the first position (index = 0). Since you were getting an empty list, there is a very good chance that the Arduino will indeed be the first item in the list.

The art of getting good answers lies in asking good questions.

donone


arduino-malaysia

Just want to add my thought here.

1. The Arduinoscope Usage wiki page have 2 link for libraries and arduino sketch.

The libraries need to be unzipped to arduinoscope folder in the usual place where to put Processing library. In Windows this is [My Documents]\Processing\libraries.

2. The so called Arduino patch is actually a sketch to be uploaded to Arduino. The link in Usage wiki page is actually broken due to spelling error. I got scared looking at arduino-arduinoscope.pde file name. So rename it to arduinoscope.pde. Copy this file to a folder that must be the same name as the sketch name (without extension). The folder location is in the usual Arduino sketch folder location. In windows this is [My Documents]\Arduino\sketch.

3. IMHO SimpleSerialArduinoscope use the first available comport (if it is available at all!). Due to the source code that take item 0 in list of com port.

Code: [Select]
port = new Serial(this, Serial.list()[0], 115200);

This means that if Arduino board in com port 9 while there are other preceeding com port number. This can be a problem.

Have not test this. Just bouncing some opinion.

Blog about starting up with Arduinoscope Link ->
http://www.homebrew-tech.com/arduino/brewing-arduino-announcement/usingarduinoasoscilloscope-arduinoscope

Warning this is a very long and boring writeup probably with lots of wrong info that is going to be clean up as it being reviewed.

Cheers and have a nice weekend!

Go Up