#include "GoogleFormPost.h"
#define FORM_ROOT_URL "https://docs.google.com/forms/d/e/1FAIpQLSevaYJa3Y5sI-YYIucB9DW8ZgUg2xj81e83IGyIptuhVWzOkQ"
//#define FIELD_ID_1 "entity.12345678"
const char* ssid = "Wokwi-GUEST";
const char* password = "";
bool postOnce;
void setup() {
Serial.begin(115200);
// Conéctate a la red Wi-Fi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(100);
}
Serial.println("Conexión Wi-Fi establecida");
delay(100);
postOnce = true;
}
void loop() {
if (postOnce) {
GoogleFormPost gf;
gf.setDebugMode(true);
gf.setFormUrl(String(FORM_ROOT_URL));
// version without knowing the field IDs
int i = gf.readFields();
if (i>0) {
gf.addData("100");
//gf.addData(String("Random:") + String(random(100)));
gf.showDebug();
gf.send();
Serial.println("Enviado");
}
// or if we did know them:
postOnce = false;
}
}