hi
thought I would provide more specific info,
I made a temporary website for the project here:
http://org-urb.dk/luft/uk/
Below is the code I am having trouble with, both scripts seem to work individually, but I cant make them play together, it is a question of sorting and sending the right information i think
Code:
/ http client
// by Tom Igoe
// Starts a network client that connects to a server on port 80,
// sends an HTTP 1.1 GET request, and prints the results.
// created March 18, 2005
import processing.net.*;
Client client;
void setup()
{
size(200, 200);
noStroke();
// Open a TCP socket to the host:
client = new Client(this, "www2.dmu.dk", 80);
// Print the IP address of the host:
println(client.ip());
// Send the HTTP GET request:
client.write("GET /atmosphericenvironment/thor/mjk/melding.inc
HTTP/1.1\n"); //this points to the file on the internet with the data
client.write("HOST: www2.dmu.dk\n\n");
}
void draw()
{
background(0);
// Print the results of the GET:
while (client.available() > 0) { //changed if to while from original code
int inByte = client.read();
print((char)inByte);
}
}
//this prints the file that I am interested in hurray
/* Example of what is printed:
this is an example of what the http client writes
195.41.77.12
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Date: Mon, 29 Aug 2005 08:15:03 GMT
Content-Type: application/octet-stream
Accept-Ranges: bytes
Last-Modified: Mon, 29 Aug 2005 05:13:27 GMT
ETag: "c3fc566358acc51:96b"
Content-Length: 25
20050829
1,2
2,2
3,3
*/
/*
this is what I think follows, the code below works alone but not together with the above
what i want to do is send data to the serialport
I dont know a way to point to the right number yet, I
am interested in the line: 1,2 and then the second number, in this case 2
*/
/* code is commented out for now as it doesnt work together
import processing.serial.*;
// the serial port:
Serial port;
// variable to hold values:
int thisByte = -1;
// list all the available serial ports:
// println(Serial.list());
//the port is set to 2 and baudrate set to 2400
port = new Serial(this, Serial.list()[2], 2400);
// Send data to serial port, trough variable inByte, -could be this
command is also wrong:
port.write(thisByte);
}
*/