Practical Arduino logic analyser can't get going

Thank you for adding to this Jon, again a clear and useful explanation. I have found that there is not a real 'thread' to follow when first encountering Arduino, even the Arduino web site, and little to indicate the obvious web of interconnections that somewhere provide the required path to follow.

Your comments and a few judicious Google's have I think shown me that I entered the chain some distance along it without realising that. One of those searches brought me the book you mention and I believe that I am now on my way. The Playground appears to be a internet in itself. Processing should be called the 'missing link'.
Thank you again for your timely intervention!

[Edit] Most problems here, on both sides, seem to be about making assumptions while lacking anything else, and failure to recognise the need to state where one is at before stepping in.

OK, things weren't 100% clear. I mean that when I have all the downloaded stuff there are a million files and folders.
I am getting errors when running the processing, simple arduinoscope because I have not got libraries in folders under Sketches.
I have the folder structure for processing but when I am trying to find the libraries I don't know which folders to find them in, in order to move them, nor do i know the file extension I am looking for.

I cannot run the processing exe file because I have changed parameters and am trying to run the scope from the processing ide.

Could somebody please give me a precise folder structure under processing\sketchbook so that I can take the original downloads and move them appropriately. I don't see why only the needed files aren't included.
I am sure that such information will teach me something for the future.

In your original message you mentioned that you were working on the project from Practical Arduino, and at one point I said I assumed that meant you had read the book. That was never clarified though, so I'll ask it directly: do you have Practical Arduino? Have you been through the steps described in it?

Jon
Freetronics: www.freetronics.com

Ah! Well I think there must be confusion on my part because I have read the book and again a few moments ago and I still can only see that I have to run the Processing App. It does say that I can edit certain parameters and i have done that in the .pde. Then instead of running the app (exe) I have to run the .pde in the Processing IDE, which I do and it says it cannot find Arduinoscope and it must be a missing library. I know where it is saying it should go, but I cannot find it.

I must be dense, and you must be frustrated, but perhaps it would be easy if I could compile the .pde to exe instead of running it in the IDE every time. That aside, what am I missing? Am I trying too hard to do something I shouldn't?

Then instead of running the app (exe) I have to run the .pde in the Processing IDE, which I do and it says it cannot find Arduinoscope and it must be a missing library. I know where it is saying it should go, but I cannot find it.

I must be dense

I wouldn't go that far, but it would be helpful if you could use nouns instead of pronouns more often, and copy and paste actual program output.

You need to start Processing, load a sketch, then run that sketch.

it says it cannot find Arduinoscope and it must be a missing library.

There are a lot of its in that short statement, and no clear output. Please define exactly what each "it" refers to, and show some actual output.

This really should not be that hard, but, clearly there are assumptions being made by the book's author(s), by you, and by us. One or more of those assumptions must be be correct. We'll help you figure out which one(s) are incorrect, and try to do something about it.

What is a pronoun...
A pronoun can replace a noun or another pronoun. You use pronouns like "he," "which," "none," and "you" to make your sentences less cumbersome and less repetitive.

In this case 'it' which I feel sure was actually decipherable in that the first two referred to the same thing, the IDE compiler, not much else was involved to give error messages! The third followed Arduinoscope which is an object and so that is what it referred to.
I know you really are a teacher in disguise :slight_smile:
The presumptions that 'you' make are that I am naturally English speaking and that I am not a person with learning difficulties.

However, I stand corrected!!! I apologise for my hurried and poor grammar and hope that you are not offended by my response. I also know that I should not have put exclamation marks in the body of this sentence.

Here goes...
The Processing IDE issued a error message when I attempted to compile 'simpleserialarduinoscope.pde'. The message indicated that The package "Arduinoscope" did not exist and that I might be missing a library. I was then told by the Processing IDE where to place the library when and if I found the library.
The reason that I was running Arduinoscope in the IDE and not running the executable provided was because I had made changes to parameters within the source file.

I suspect (presume) that all the files and folders provided in the downloads that I mentioned in an earlier post in response to an earlier admonition, are not required and that in itself has caused some of my confusion.
I have been unable to find a comment (which I must have missed) in the book

that I have read twice, that explains where the files go. I suspect that the folder network provided is not in a usable form exactly as the folder nest is provided. Some items appear to require moving and I am asking for somebody to kindly help me work out precisely which items go where in the system that I have got set up which is...
A Arduino Folder above Sketchbook above libraries and a Processing folder above Sketchbook above libraries.
When I know the answer that I seek, I feel sure that it will serve me well in future endeavours of this nature.

It is also very easy for those to whom this particular aspect is second nature, to forget that their is a first nature.

You need to start Processing, load a sketch, then run that sketch.

I did and received the error message to which I referred a few moments ago. Though I think I know, you didn't say which Sketch.

I know you really are a teacher in disguise

I am an engineer by training and a programmer by choice. Both professions require logical thinking and the ability to clearly express ideas. I am a teacher only to the extent that I like the Arduino and I want to help other people learn to like and use it, too.

The presumptions that 'you' make are that I am naturally English speaking and that I am not a person with learning difficulties.

I've made others, too. I am not even consciously aware of having made them, so learning what assumptions I've made, which ones you've made, and which ones the author(s) have made is a discovery process for all of us.

I apologise for my hurried and poor grammar and hope that you are not offended by my response. I also know that I should not have put exclamation marks in the body of this sentence.

No need to apologize. You've done nothing wrong. All that you have done is get frustrated when things didn't go as you expected, which is perfectly normal. I am not offended by completely rational reactions.

The Processing IDE issued a error message when I attempted to compile 'simpleserialarduinoscope.pde'. The message indicated that The package "Arduinoscope" did not exist and that I might be missing a library. I was then told by the Processing IDE where to place the library when and if I found the library.

This is good. Now, we know exactly what you are doing.

I am able to reproduce this problem, too. Now, let me see if I can figure out the problem. Be right back.

The instructions here are kind of vague.
http://code.google.com/p/arduinoscope/wiki/Usage

To get started with changing it, or doing something different, extract the processing lib into your sketch library dir, in a folder called "arduinoscope", or whatever you want.

You need to create, if you haven't already, a folder named libraries, in the Processing sketchbook folder. Then, you need to create a folder, in the libraries folder, named exactly "arduinoscope", not whatever you like.

Then, start the Processing IDE, and select File + Sketchbook + libraries + arduinoscope + examples + one of the example files.

Now, when you try to run the SimpleSerialArduinoscope example, you will get a different error message. This time, it says "The package "controlP5" does not exist. You might be missing a library.". The code says that the controlP5 package is available from processing GUI, controlP5. Let's see what adding that does.

Be right back.

I downloaded the controlP5 zip file, and created a controlP5 directory in libraries. I extracted the zip file into that directory, and now the SimpleSerialArduinoscope sketch compiles, links, and runs.

The instructions for installing all the pieces and getting everything to work are not good at all. I don't blame you for getting frustrated. The Practical Arduino folks should have done a better job explaining that it is a multi-step process, and should have provided screen shots of installing all the pieces, for some version of Processing on some OS. That would have made it much easier to figure out how to do it for a different OS or different version of Processing.

I thank you for continued support.

As stated I did produce the folders up to your quote except that what I actually did was to rename 'processing-arduino' to arduino and place it wholesale under libraries.

Then, you need to create a folder, in the libraries folder, named exactly "arduinoscope", not whatever you like.

Then, start the Processing IDE, and...

The only other difference is that I picked up the example file SimpleSerialArduinoscope.pde and dropped it on the Processing IDE and opened.
On this occasion I followed your instructions by going through the menu and path. Upon running I still got the same error.

To save questions; in libraries I have Arduinoscope\ then src & reference & library & examples.
In examples\ I have 3 examples one of which is SimpleSerialArduinoscope folder containing a data folder and java.policy.applet and SimpleSerialArduinoscope.pde

I obviously reserve the rest of your guidance for after this step is resolved.

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.

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.

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

#define FRAMES 6

in it, so that you could change the number of frames in one place, and have it reflected everywhere.

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.

Try commenting out the line

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.

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.

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.

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

We can hope so.

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.

A final thank you for your valuable help.

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.

  1. 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.

  2. 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.

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 ->

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!