#include "cJSON.h"
#include "stdio.h"
Go to the source code of this file.
◆ 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
-
| current | current value |
| error | error value, deviation of current from setpoint |
| P | Value of Proportional Gain (P) |
| I | Value of Integral Gain (I) |
| D | Value 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
-
| data | Pointer to char array containging the json formatted string |
- Returns
- struct pid_const - Returns a array of PID constants, extracted from the json string