Go Down

Topic: Arduino Networked Lamp Processing sketch error. (Read 7067 times) previous topic - next topic

Hi. Total newb here. You have been warned.  :smiley-mr-green:
      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? :smiley-sweat:




Coding Badly


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

[font=Courier New]URL url = new URL ( feed);[/font]

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.

Coding Badly

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.

Coding Badly

#5
Dec 27, 2012, 12:13 am Last Edit: Dec 28, 2012, 09:56 am by Coding Badly Reason: 1

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.


PaulS

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.


conejito

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?

PaulS

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

conejito

Paul: yes, that't the problem (http://arduino.cc/forum/index.php?topic=131981.0). I had problems using both Mac and Windows with 2.07b and 1.51 works like a charm.

aqui1a

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;

xKoldFuzionx

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

spino952

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?

Go Up