Any suggestions?
Yes. Try to make your code make sense.
{incomingByte = URL[5];
NOTHING else goes on the line with the {
{
incomingByte = URL[5];
If you INSIST on putting them together, at least use some damned space between the { and the statement.
if(incomingByte >= 48 && incomingByte <=57){
Maybe you got your jollies memorizing the ASCII table, but the rest of the world finds this:
if(incomingByte >= '0' && incomingByte <= '9')
{
easier to understand.
if (URL[1] == '?' && URL[2] == 'L' && URL[3] == 'E' && URL[4] == 'D') //url has a leading /
So?
if(strncmp(URL, "/?LED", 5) == 0)
{
}
Much easier to understand and change.
incomingByte = URL[5];
if(incomingByte >= 48 && incomingByte <=57){
webnum = incomingByte - 48;
should be
incomingByte = URL[5];
if(incomingByte >= '0' && incomingByte <= '9')
{
webnum = incomingByte - '0';
Of course, why sendPage() returns a boolean, when the value that it returns is hardcoded to true is a mystery.
option1State? What is option1?