Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Oty1
#34496 I could add a 404 error but I am actually have a problem that when the Get request for the facicon comes through it brings 0's along with it which change the duty cycle of my LED's.

Please see picture attached. This lists first the values that I entered for the frequency then the 3 duty cycles which are set and work very briefly before the Get request for the favicon is sent and bring's 0's which reset the duty cycle.

Do you have any idea's on a better way to handle the favicon so that it doesn't reset the values?

The if statement that I mentioned in my previous post does not seam to be working correctly as the LED's do not blink to the frequency and duty cycle that I try to set.
You do not have the required permissions to view the files attached to this post.
User avatar
By Oty1
#34503 Ok how would you extract them properly?

I wanted to have it look for the the arguments but had problems on how to do it. Below is how I tried in my origional code.
Code: Select all  if (req.indexOf("/?freqVal1") != -1){
    FreqValue = req.substring(req.indexOf("=") + 1,req.indexOf("//"));
    Serial.println("The Frequency Value is:");
    Serial.print(FreqValue);
    Serial.println();
    Serial.println();
//Gets the new frequency number the user entered
FreqValueToSet = FreqValue.substring(0,FreqValue.indexOf("/"));
Serial.println("The Frequency Value is:");
Serial.print(FreqValueToSet);
Serial.println();   
Serial.println();
FreqValueToSet.toCharArray(floatbuff, sizeof(floatbuff));
    FreqValueNew = atoi(floatbuff);
    Serial.println("Frequency is set to: ");
    Serial.print(FreqValueNew);
//Set the Frequency
//analogWriteFreq(FreqValueNew);
  }


I was having problems with my original code not working so I tried to rewrite it to make it better and below is what I thought would work better.
Code: Select all//Will give you the frequency value
String FVFind = req.substring(req.indexOf("l1"));
//Serial.println();
//Serial.println(FVFind);
String FV = FVFind.substring(3,FVFind.indexOf("/"));
Serial.println();
Serial.println(FV);
Serial.println("''''''''''");
float FVFloat = FV.toFloat();
Serial.println(FVFloat);
Serial.println("''''''''''");



I haven't done much programming before so I don't really know the best way's to do things.

Thank you for the help so far.