Code:
unsigned long lastTime;
if(digitalRead(buttonPin2)==HIGH)
{
if (lastTime+250<millis()) {
Setpoint+=1;
lastTime=millis();
}
}
if(digitalRead(buttonPin2)==HIGH)
{
if (lastTime+250<millis()) {
Setpoint+=1;
lastTime=millis();
}
}
That way, you can click the button once, and it'll increase one degree, or hold it down to increase at a rate of 4 per second. With a bit more coding, you could have it count how long the button stays down, and after say, 2 seconds, have it increase the rate of change.