Hey, folks, I found a Ubidots article written by Isabel Lopez. It details the process for sending data from the Arduino MKR WiFi 1010 devise to Ubidots. It works just fine however I am trying to integrate the necessary code to send a value coming from an attached Pressure Sensor.
Any help would be great.
Here is the article URL for referring to Isabel’s code.
Next Here is both her code and my code for constructing the data to send. I only need to send pressure_inhg at this time.
//ISABELS CODE START
/4 is the total lenght of number,maximun number accepted is 99.99/
float value = analogRead(A0);
dtostrf(value, 4, 2, str_val_1);
sprintf(payload, “%s%s”:%s", payload, VARIABLE_LABEL_1, str_val_1);
sprintf(payload, “%s}”, payload);
//ISABELS CODE END
//MY CODE START
float voltage = (sensorVal5.0)/1024.0;
float pressure_pascal = (3.0((float)voltage-0.47))1000000.0;
float pressure_bar = pressure_pascal/10e5;
//FOR NOW I ONLY NEED TO SEND THE FOLLOWING VALUE - pressure_inhg
float pressure_inhg = pressure_bar29.53;
float pressure_mpa = pressure_inhg/295;
//MY CODE END
//Send the payload to Ubidots