I have Arduino mega and shield, I am sending data to the asp.net mvc project from these Arduino digital pins and I am researching a faster method. I will give you a sample code, can you help me?
int ArduinoJobHistory()
{
int maxRetryCount = 10; // We will repeat the API call a maximum of 3 times
int retryCount = 0;
while (retryCount < maxRetryCount) { // while
String postRequest = "GET /home/ArduinoJobHistory?jobOrderFK=" + jobOrderFK +"&&IpAddress="+post_IpAddress+" HTTP/1.1\r\n" +
"Host: yagmur.autobot.com.tr\r\n" +
"Connection: close\r\n" +
"\r\n";
if (client.connect(server, 80)) {
client.print(postRequest);
while (client.connected()) {
if (client.available()) {
jobOrderHistory = client.readStringUntil('\n');
}
}
client.stop();
return jobOrderHistory.toInt();
}
else {
// API call failed, let's wait 5 seconds to try again
retryCount++;
}
} // while
return jobOrderHistory.toInt();
}