system
January 20, 2010, 5:18am
#1
I've followed the following site:
http://www.scienceprog.com/getting-hands-on-arduino-ethernet-shield/
and I really want to figure out a way to read in different values for the LED. For example if you called the website on the arduino as http://192.168.1.1/?k1=XXX I want to be able to parse XXX into a variable for use later.
Any suggestions?
Thanks in advance!
system
January 20, 2010, 12:11pm
#2
My suggestion would be to read the request parameters. (Maybe using strtok_r).
Then extract the value from the argument (k1), and parse it, using atoi.
Does that help?
system
January 20, 2010, 5:11pm
#3
I might be making this a lot harder then needed....
There's only ever going to be a possibility of maybe 4 values for the 2 variables.
It's ugly but I can just hard code each of them. so in psuedo
if {
k1=29
value1=29
}
if {
k1=12
value=12
}
if {
k2=23
value1=23
}
if {
k2=16
value=16
}
Like I said...it's ugly but with only 8 ever possibilities it might be ok...