We can't guess whether you are saving the data, and then trying to parse the data, or if you expect various undefined classes to have methods that will perform magic for you.
cammoore:
At the moment I have this, however if I change "Swell" to a word that doesn't exist. Pin 13 does not go high
Arduino board used?
other hardware used?
circuit schematics?
full sketch code?
If, for example, I'm acting as a mind reader and make the guess that you are using an Arduino UNO board and an Ethernet Shield with Wiznet W5100, then the Ethernet hardware is controlled by SPI bus, and pin-13 is the SPI clock pin of the UNO board.
You cannot use the SPI clock pin as a general output pin, while using pin-13 for any connected SPI device at the same time.
But I'm really bad in mind reading, so possibly you are doing much different bullshit than what I described.
You're a pretty good mind reader, I am using the UNO with the W5100. Here is the code I am using. It has LED's hooked up to pins 7,8 and 9. I've tried changing using pin 13 to another LED I have hooked up to the board with no luck.
Thats not the issue I'm having, the rest of the code works fine. When the word "swell" exists it reads the number next to it and turns the corresponding LED on. When the word swell doesn't exist, the code doesn't work, it treats the variable 'waveheight' as 0 and turns on the corresponding LED. Where it should turn ALL of the LED's on.
I am trying to find a way where I can search for a word off a webpage, if that word exists return some value, if it doesn't resist, return a different value.
cammoore:
Thats not the issue I'm having, the rest of the code works fine. When the word "swell" exists it reads the number next to it and turns the corresponding LED on.
Really? You actually get a valid HTTP response to the malformed HTTP request you are sending?
If I'd make guess you possibly would get a "404 - Not Found" or "503 - Server Error" or something like that back as a response only. But your Arduino will receive a valid HTTP response?
BTW: On the actual response in my webbrowser I don't see the word "swell", but I see "Significant Wave Height:" as text.
So sometimes the same page shows ""Significant Wave Height:" and you want to ignore that, but at different times the same page shows "swell" and you want to find that?
if (client.connect(serverName, 80)>0) {
client.println("GET http://www.ndbc.noaa.gov/data/latest_obs/62081.rss");
}
A GET request does NOT involve a protocol (http://) or a server name (www.ndbc.noaa.gov). You connected to the server already, so the get request should simply be:
client.println("GET data/latest_obs/62081.rss");
When the word swell doesn't exist, the code doesn't work,
You need to look at how the find() method works. It reads and discards data UNTIL IT FINDS THE SEARCH PHRASE. Only then does it return.
You REALLY want to read and store all the data from the server and THEN parse the data. Only that way can you take action on a phrase not being in the response (because you know what the whole response is).
So sometimes the same page shows ""Significant Wave Height:" and you want to ignore that, but at different times the same page shows "swell" and you want to find that?
Yes that is correct, but I also want to be able to tell if "Significant Wave Height:" isn't there.
but I also want to be able to tell if "Significant Wave Height:" isn't there.
The find() method really should be called the waitForStringToAppearInStream() function. It can NOT determine if the string it is supposed to find will never appear. Get over it.