IpidReverse() selects direct or reverse PID action.
void IpidReverse(uint8_t id, bool reverse)
void setup() {
IpidSet(2, 4.0, 0.2, 0.0, 100, 0, 255); // Set PID coefficients, calculation interval and output range.
IpidReverse(2, true); // Select direct or reverse PID action.
}
void loop() {
float pv = ntcRead(4) / 10.0; // Return the NTC 3950 10kΩ sensor temperature as an integer in 0.1°C units.
float sv = 25.0;
int output = (int)IpidRun(2, pv, sv); // Calculate the PID output from the current value and setpoint.
analogWrite(11, output);
}