Arduino Networked Lamp Processing sketch error.

Hi. Total newb here. You have been warned. :grin:
When I wrote the processing sketch part of this project, the program highlights the line
URL url = new URL9feed); it tells me that it cannot find a class or type named URL.

In my frustration I went to the page with the code and copy pasted it into a new sketch and I still get the same error.
Can anyone tell me what is going on? :sweat_smile:

Two things...

  1. This is not a Processing forum. While you may get lucky and cross paths with someone who can help, I suspect you will find better help faster on a Processing forum.

  2. The "9" should be an opening parenthesis...

URL url = new URL ( feed);

Well I thought since this is a rather common arduino project that someone might be able to help. I fix that little mistake and have gone over the code again and I still seem to be getting that error.

DevilsSoul:
I fix that little mistake and have gone over the code again and I still seem to be getting that error.

Is this the code you are trying to build...

http://cdn.makezine.com/make/books/getstartedarduino/eg/Example_08A.txt

Yup. Copied and pasted that in and all I get is that error message when I try to run the script.

It's outside my sphere.

If you don't get a reply after about 12 hours bump this thread. I'll move it to Networking Interfacing w/ Software on the Computer.

bump

What version of Processing are you using? That sketch compiles fine for me using 1.5.1. It has some issues running, since the font it is looking for doesn't exist, but that's easily corrected, and may not be a problem on your system.

I am using PROCESSING 2.0b7 (REV 0215).

DS: Don't feel bad. I am having this same problem. When I worked around the URL based code it then objected to the StringTokenizer immediately below it. It looks like the import is not bringing in libraries the author expected. I've been searching for some help with this but hampered by the idiotic choice of language name -- why didn't they just call it "Programming" to be completely generic?

I suggest that both of you install the 1.5.1 version of Processing. The 2.0+ version just doesn't seem to play well with the Arduino (or Windows, apparently).

Paul: yes, that't the problem (Arduino Forum). I had problems using both Mac and Windows with 2.07b and 1.51 works like a charm.

Hey Everyone,

I just joined this site and am reading through that same book.

For anyone searching for this same problem. You don't have to revert back to older version.

Processing is essentially Java. You can fix this by importing some Java classes.

here is my import section for that code:

import processing.serial.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

I was just working through this same thing. Thanks for the code! That came in handy. I'm not familiar with Java or C++, though one time I tried to create a text game using only DOS commands. lol

Hi, with the java classes i've fixed the url problem, but now it can't load the HelveticaNeue-bold font...
Did you have the same problem?

but now it can't load the HelveticaNeue-bold font...

Does the font that Processing uses REALLY matter? Have you placed the appropriate font file in the appropriate directory?

I was not able to figure out how to fix the font problem so I simply commented out the lines like this:

//font = loadFont("HelveticaNeue-Bold-32.vlw");
fill(255);
// textFont(font, 32);

Then the program ran but produced no results.
The URL from the book is not responding I think.
I changed the URL like this:
String feed = "http://blog.makezine.com/index.html";

I was then getting results .

Thanks for the help above with the java includes. I would never have overcome that problem.

Hi all, i am not very familiar English, sorry for my poor English.
I am now using processing 2.1 for this project and i've revised my code by including java with codes mentioned above:

import processing.serial.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

yet, when I tried to run this program, Processing stopped and show error message "The package "java.io,BufferReader" does not exist. You might be missing a library."

I'm a totally newbie ,I don't know if it is suitable to ask here (this is the only forum I know)
Is there any suggestion where I can download the libraries and how to install it?

The error message does not match with the snippet of code you posted. (Buffered != Buffer).

thanks! this error is caused by my typo... :disappointed_relieved: