0% found this document useful (0 votes)
7 views2 pages

ESP8266 Arduino JSON Example Code

The document includes code to create a JSON object from sensor data and print it to the serial port when a character is received.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

ESP8266 Arduino JSON Example Code

The document includes code to create a JSON object from sensor data and print it to the serial port when a character is received.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <ESP8266WiFi.

h>
#include <ArduinoJson.h>

void setup() {
// put your setup code here, to run once:
[Link](9600);
}

void loop() {
// put your main code here, to run repeatedly:
if([Link]() == 'j') {
DynamicJsonBuffer jBuffer;
JsonObject& root = [Link]();

root["day"] = "Monday";

int temp = 21;


int humidity = 53;

root["temperature"] = temp;
root["humidity"] = humidity;

[Link](Serial);
[Link]();
}
delay(2000);
}#include <ESP8266WiFi.h>
#include <ArduinoJson.h>

void setup() {
// put your setup code here, to run once:
[Link](9600);
}

void loop() {
// put your main code here, to run repeatedly:
if([Link]() == 'j') {
DynamicJsonBuffer jBuffer;
JsonObject& root = [Link]();

root["day"] = "Monday";

int temp = 21;


int humidity = 53;
root["temperature"] = temp;
root["humidity"] = humidity;

[Link](Serial);
[Link]();
}
delay(2000);
}

You might also like