Read and write data throw web browser

I have an Arduino WiFi Rev2 which I would like to receive inputs in a browser for example integer then run my loop and return feedback. Is it possible?

Are you referring to accessing your Arduino from a web browser? If so, I wrote a tutorial on this a while back.

Yes, exactly I need to send integers from browser instead of making button. The tutorial you provide is using low and high flag for making led on and off but I need to receive value from browser.
There is a possibility to use UDP, but I couldn't find something clear.

I don’t know how you are wanting to obtain the integers in your HTML, but as a proof of concept you could do the following.

Start with the example SimpleWebServerWifi sketch (Main Menu > File > Examples > WiFiNINA > SimpleWebServerWifi) and update your credentials in the arduino_secrets.h file.

Just after the line

client.print("Click <a href=\"/L\">here</a> turn the LED on pin 9 off
");

line, around line 89 of the sketch, add the following line

client.print("Click <a href=\"/IB175IE\">here</a> send integer
");

which sends the integer of 175 between the IB and IE delimiters.

Then after the

if (currentLine.endsWith("GET /L")) {
  digitalWrite(9, LOW);                // GET /L turns the LED off
}

around line 107, add the following

if (currentLine.startsWith("GET /IB") && currentLine.endsWith("IE")) {
  int firstIndex = currentLine.indexOf("IB");
  int lastIndex = currentLine.lastIndexOf("IE");
  int intReceived = currentLine.substring(firstIndex + 2, lastIndex).toInt();
  Serial.print("Integer Retrieved: "); Serial.println(intReceived);
}

which will parse and print the 175 integer.

You should see the following printed in the Serial Monitor.
Integer Retrieved: 175

Hope this helps.

Thanks. :slight_smile: