Hey all! I am currently playing with some of the PID scripts and my seeeduino.
I’ve got it hooked up to two things, a heater to heat to the set temp and a thermocouple to take the readings and adjust accordingly.
My questions are about the script…
I’ve got the following script uploaded to my board:
/********************************************************
- PID Simple Example
- Reading analog input 0 to control analog PWM output 3
********************************************************/
#include <PID_Beta6.h>
//Define Variables we’ll be connecting to
double Setpoint, Input, Output;
//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint, 2,5,1);
void setup()
{
//initialize the variables we’re linked to
Input = analogRead(0);
Setpoint = 150;
//turn the PID on
myPID.SetMode(AUTO);
myPID.SetSampleTime(250);
myPID.SetTunings(2,3,1);
}
void loop()
{
Input = analogRead(0);
myPID.Compute();
analogWrite(3,Output);
}
Now, when the board is turned on, it starts heating to the setpoint and does a magnificent job of keeping it there.
What I am trying to achieve is adding a on/off button to trigger the board to start heating the element ONLY when the signal from the button is received Also, I would like to add two buttons that adjust the temperature UP or DOWN, and a LCD readout of the Setpoint, and the ACTUAL temperature VIA a single serial wire.
Can anyone point me to the direction where I might find an example of this? Or simply throw the code down in a post? I would imagine the first two things I am trying to achieve are relatively simple in terms of coding. The simple on/off thing and temp up/down in response to the buttons.
Thanks in advance for all your responses!