PID plotter component  1.0
ESP-IDF component for pid plotter
json_handler.h
Go to the documentation of this file.
1 /* JSON STRUCTURE
2 
3 Json with PID data to be sent to client
4 
5 {
6  "current" : current,
7  "error" : error,
8  "P" : P,
9  "I" : I,
10  "D" : D
11 }
12 
13 Json with Kp,ki,kd and setpoint data to be recieved
14 
15 {
16  "kp" : kp,
17  "ki" : ki,
18  "kd" : kd,
19  "setpoint" : setpoint
20 }
21 
22 */
23 
24 #ifndef JSON_HANDLER_H
25 #define JSON_HANDLER_H
26 
27 #include "cJSON.h"
28 #include "stdio.h"
29 
30 struct pid_const
31 {
32  float kp;
33  float ki;
34  float kd;
35  float setpoint;
36 };
37 
38 char *create_pid_data_to_json(float current, float error, float P, float I, float D);
39 struct pid_const read_pid_data_from_json(const char* data);
40 
41 #endif
float ki
Definition: json_handler.h:33
float kp
Definition: json_handler.h:32
float setpoint
Definition: json_handler.h:35
Definition: json_handler.h:30
char * create_pid_data_to_json(float current, float error, float P, float I, float D)
Converts PID data to a json string.
Definition: json_handler.c:13
struct pid_const read_pid_data_from_json(const char *data)
Reads PID constant data from a json formatted string.
Definition: json_handler.c:36
float kd
Definition: json_handler.h:34