correct math.h header and specify wificlient as per new http library requirement

This commit is contained in:
Mark Polyakov
2021-05-29 00:04:15 -07:00
parent 0753a4c9dd
commit 0abc5629fc
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@
#include <SoftwareSerial.h>
#include "Arduino.h"
#include <Wire.h>
#include <Math.h>
#include <math.h>
// Constructor /////////////////////////////////////////////////////////////////

View File

@ -37,6 +37,8 @@ AirGradient ag = AirGradient();
SSD1306Wire display(0x3c, SDA, SCL);
WiFiClient client;
// set sensors that you do not use to false
boolean hasPM=true;
boolean hasCO2=true;
@ -100,7 +102,7 @@ void loop(){
String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(),HEX) + "/measures";
Serial.println(POSTURL);
HTTPClient http;
http.begin(POSTURL);
http.begin(client, POSTURL);
http.addHeader("content-type", "application/json");
int httpCode = http.POST(payload);
String response = http.getString();