PID plotter component  1.0
ESP-IDF component for pid plotter
Classes | Functions
json_handler.h File Reference
#include "cJSON.h"
#include "stdio.h"
Include dependency graph for json_handler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pid_const
 

Functions

char * create_pid_data_to_json (float current, float error, float P, float I, float D)
 Converts PID data to a json string. More...
 
struct pid_const read_pid_data_from_json (const char *data)
 Reads PID constant data from a json formatted string. More...
 

Function Documentation

◆ create_pid_data_to_json()

char* create_pid_data_to_json ( float  current,
float  error,
float  P,
float  I,
float  D 
)

Converts PID data to a json string.

Parameters
currentcurrent value
errorerror value, deviation of current from setpoint
PValue of Proportional Gain (P)
IValue of Integral Gain (I)
DValue of Derivative Gain (D)
Returns
char* - Json string of the data sent through parameters.

◆ read_pid_data_from_json()

struct pid_const read_pid_data_from_json ( const char *  data)

Reads PID constant data from a json formatted string.

Parameters
dataPointer to char array containging the json formatted string
Returns
struct pid_const - Returns a array of PID constants, extracted from the json string