oh your realy new to code.. well ehmm you should dive into it why else you have an arduino?.
I dont have the ethernet shield so i cannt really rewrite and test your code.
Well maybe i still can help you, and give you guidance
As a general note type correctly
As i see in your code
int lux_v1 = readString.substring(7, 11);
int lux_v1 = readString.substring(12, 16);// lux_v2 = readString.substring(12, 16)
i added some marked command // is for marking
in you code you give lux_v1 a value and the next line does the same to the same value
But most likely you wanted it to assign to lux_v2
Are those perhaps the values you would like to work with ?
Because there you took parts of string called readString
For strings, a string = "text like this"
The first character is counted as zero
So the command substring, takes from readstring the 0123456 7th character till the 11th
However by nature if you take part of a string it will returned as a string to you.
There is a function to convert a number inside a string to an int
// put this in the setup part
int A = 0;
int B = 0;
now you program knows of two variables A and B
You also had lux_v1 and lux_v2 who where not int's but strings
This how you get their text numbers into an int, place it in your main program below after where i spoted your typo.
A = int(lux_v1);
B = int(lux_v2);
Instead of A you might also name them like Lux_v1_AsNumber perhaps more easy?
I also note that you use a function called atoi()
as far as i know this is not part of the arduino language, i couldnt find a reference of it (there is no atoi here : http://arduino.cc/en/Reference/HomePage
but perhaps its a function that was part of Spi or Ethernet includes ? well perhaps might be.
Oh nextyou have serial output... and web output.
So you should also upate your webpage with A and B i suppose ?
Take a look at your seccond usage of your <body> statement ... that should be </body>
But just above that line you might write
client.println (<br>); // in html web page language that is a new line
client.print ( "First value :");
client.print ( lux_v1 ); // yes we can keep the string, you might try int version too
client.print ( "Second value :");
client.print ( lux_v2 );
I hope you will manage with this help, i cannt test your solutions.
What's always a good approach to programming is to divide your problems into smaller ones. Or slowly extend your program, with a lot of file saves in between. so your working code extends, until you reach a problem. so then you know its there. then try to solve it in small parts, look perhaps how other people solved similar c++ coding problems, hang around c++ forums, or place newbie questions at "stack overflow" >> google it.
You can also slowly extend the sample programs its a good way to learn how to code.
Books are nice too, (but borring too) just try to code, thats where it all starts..