SIM900 Y SUBIDA A SERVIDOR

buenas noches tengo un problema tengo un código para el conteo de objetos y uno para subir datos al servidor pero no he podido hacer que funcionen juntos pretendo que despues de 100 objetos se actualice el servidor y vuelva la cuenta a 0 podrian ayudarme de favor?

CONTEO.

#include <String.h>;

int sensor1=5, cont=0, cont1=0, sensor2=6, contT=0;

void setup() {
Serial.begin(19200);

pinMode(sensor1,INPUT);
pinMode(sensor2,INPUT);
}

void loop() {

int ent1=digitalRead(sensor1);
int ent2=digitalRead(sensor2);
{
if(ent1==HIGH)
{
cont++;
while(ent1==HIGH){
ent1 = digitalRead(sensor1);
}
}

if(ent2==HIGH)
{
cont1++;
while(ent2==HIGH){
ent2 = digitalRead(sensor2);
}
}
contT=cont+cont1;
Serial.println(contT);
}

}

CÓDIGO CONEXIÓN

#include <SoftwareSerial.h>
#include <time.h>
#include <String.h>;

SoftwareSerial SIM900(7, 8); //Seleccionamos los pines 7 como Rx y 8 como Tx

String reading= “{“vehicle_id”:“2”,“amount”:35,“total_ascent”:“1”,“dates_ascent”:[“2020-01-06 11:40:01”]}”;

void setup(){
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(20000);
SIM900.begin(19200);
Serial.begin(19200);
delay(1000);

}

void loop(){
connectGPRS();
connectHTTP();
}

void connectGPRS(){
SIM900.println(“AT+SAPBR=3,1,“Contype”,“GPRS””);
delay(1000);
ShowSerialData();

SIM900.println(“AT+SAPBR=3,1,“APN”,“internet.itelcel.com””);//APN
delay(1000);
ShowSerialData();

SIM900.println(“AT+SAPBR=3,1,“USER”,“webgprs””);//APN
delay(1000);
ShowSerialData();

SIM900.println("AT+SAPBR=3,1,“PWD”,“webgprs2002"”);//APN
delay(1000);
ShowSerialData();

SIM900.println(“AT+SAPBR=1,1”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+SAPBR=2,1”);
delay(1000);
ShowSerialData();
}

void ShowSerialData(){
Serial.print("\n");
while(SIM900.available()!=0){
Serial.write(SIM900.read());
delay(50);
}
}

void connectHTTP(){

SIM900.println(“AT+HTTPINIT”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+HTTPPARA=“CID”,1”);
delay(1000);
ShowSerialData();

SIM900.println("AT+HTTPPARA=“URL”,“http://api.minitx.itzama.com.mx/add_report?vehicle=2&amount=245&ascent=10"”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+HTTPACTION=0”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+HTTPREAD”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+HTTPTERM”);
delay(1000);
ShowSerialData();

SIM900.println(“AT+SAPBR=0,1”);
delay(1000);
ShowSerialData();
SIM900.println(“AT+CIPSHUT”);//Cierra la conexión(Desactiva el contexto GPRS PDP)
delay(1000);
ShowSerialData();

}

pODRÍAN AYUDARME DE FAVOR?

I’ve deleted/merged your other cross-post @EDGARvAQ.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky “How to use this forum - please read.” post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Lee las normas del foro y edita tu post usando etiquetas para código.
Si publicas en el foro en inglés debes usar ese idioma. Si publicas tu post en español debes usar el foro en Español.