PID
Dependencies: BLE_API mbed nRF51822
RST.h@1:d3e12393b71d, 2017-01-12 (annotated)
- Committer:
- stoicancristi
- Date:
- Thu Jan 12 16:04:37 2017 +0000
- Revision:
- 1:d3e12393b71d
v2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stoicancristi | 1:d3e12393b71d | 1 | #ifndef _RST_H |
stoicancristi | 1:d3e12393b71d | 2 | #define _RST_H |
stoicancristi | 1:d3e12393b71d | 3 | |
stoicancristi | 1:d3e12393b71d | 4 | #include "mbed.h" |
stoicancristi | 1:d3e12393b71d | 5 | #include "math.h" |
stoicancristi | 1:d3e12393b71d | 6 | |
stoicancristi | 1:d3e12393b71d | 7 | #define UPPER_LIMIT 1 |
stoicancristi | 1:d3e12393b71d | 8 | #define LOWER_LIMIT 0 |
stoicancristi | 1:d3e12393b71d | 9 | #define MAX_GRADE 10 |
stoicancristi | 1:d3e12393b71d | 10 | |
stoicancristi | 1:d3e12393b71d | 11 | typedef struct |
stoicancristi | 1:d3e12393b71d | 12 | { |
stoicancristi | 1:d3e12393b71d | 13 | float setpoint; |
stoicancristi | 1:d3e12393b71d | 14 | uint8_t gradR; |
stoicancristi | 1:d3e12393b71d | 15 | uint8_t gradS; |
stoicancristi | 1:d3e12393b71d | 16 | uint8_t gradT; |
stoicancristi | 1:d3e12393b71d | 17 | } RST_aditionalData; |
stoicancristi | 1:d3e12393b71d | 18 | |
stoicancristi | 1:d3e12393b71d | 19 | class RST{ |
stoicancristi | 1:d3e12393b71d | 20 | |
stoicancristi | 1:d3e12393b71d | 21 | public: |
stoicancristi | 1:d3e12393b71d | 22 | RST(float* R, float* S, float* T, RST_aditionalData SP); |
stoicancristi | 1:d3e12393b71d | 23 | float* getR(){return m_R;} |
stoicancristi | 1:d3e12393b71d | 24 | float* getS(){return m_S;} |
stoicancristi | 1:d3e12393b71d | 25 | float* getT(){return m_T;} |
stoicancristi | 1:d3e12393b71d | 26 | void setR(float *new_R){m_R = new_R;} |
stoicancristi | 1:d3e12393b71d | 27 | void setS(float *new_S){m_S = new_S;} |
stoicancristi | 1:d3e12393b71d | 28 | void setT(float *new_T){m_T = new_T;} |
stoicancristi | 1:d3e12393b71d | 29 | |
stoicancristi | 1:d3e12393b71d | 30 | float ComputeCommand(float inputADC); |
stoicancristi | 1:d3e12393b71d | 31 | |
stoicancristi | 1:d3e12393b71d | 32 | private: |
stoicancristi | 1:d3e12393b71d | 33 | float* m_R; |
stoicancristi | 1:d3e12393b71d | 34 | float* m_S; |
stoicancristi | 1:d3e12393b71d | 35 | float* m_T; |
stoicancristi | 1:d3e12393b71d | 36 | RST_aditionalData m_SP; |
stoicancristi | 1:d3e12393b71d | 37 | }; |
stoicancristi | 1:d3e12393b71d | 38 | |
stoicancristi | 1:d3e12393b71d | 39 | #endif |