mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 00:47:17 +02:00
correct math.h header and specify wificlient as per new http library requirement
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
#include <SoftwareSerial.h>
|
#include <SoftwareSerial.h>
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <Math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
// Constructor /////////////////////////////////////////////////////////////////
|
// Constructor /////////////////////////////////////////////////////////////////
|
||||||
|
@ -37,6 +37,8 @@ AirGradient ag = AirGradient();
|
|||||||
|
|
||||||
SSD1306Wire display(0x3c, SDA, SCL);
|
SSD1306Wire display(0x3c, SDA, SCL);
|
||||||
|
|
||||||
|
WiFiClient client;
|
||||||
|
|
||||||
// set sensors that you do not use to false
|
// set sensors that you do not use to false
|
||||||
boolean hasPM=true;
|
boolean hasPM=true;
|
||||||
boolean hasCO2=true;
|
boolean hasCO2=true;
|
||||||
@ -100,7 +102,7 @@ void loop(){
|
|||||||
String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(),HEX) + "/measures";
|
String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(),HEX) + "/measures";
|
||||||
Serial.println(POSTURL);
|
Serial.println(POSTURL);
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
http.begin(POSTURL);
|
http.begin(client, POSTURL);
|
||||||
http.addHeader("content-type", "application/json");
|
http.addHeader("content-type", "application/json");
|
||||||
int httpCode = http.POST(payload);
|
int httpCode = http.POST(payload);
|
||||||
String response = http.getString();
|
String response = http.getString();
|
||||||
|
Reference in New Issue
Block a user