Or a boolean, like:
boolean RampingUp = true;
double setpoint_value_Ramp_Hold_Dump()
{
static unsigned long start_millis = 0;
unsigned long current_millis;
const unsigned long hold_1 = 1000;
current_millis = millis();
if (current_millis - start_millis >= hold_1)
{
startMillis += hold_1;
if (RampingUp)
{
setpoint += 0.1;
if (setpoint > 3.3)
{
setpoint = 3.3;
RampingUp = false;
}
}
else // not RampingUp
{
setpoint -= 0.1;
if (setpoint < 0.0)
{
setpoint = 0.0;
RampingUp = true;
}
}
}