I can fade the LED up, but I don’t know how to hold that color once the conditional statement it true:
int PWMpin = 10; // LED in series with 470 ohm resistor on pin 10
#define COMMON_ANODE
void setup()
{
}
void loop()
{
//conditional statement based on temperature
if (temperature >=50){
for (int i=0; i <= 255; i++){
analogWrite(PWMpin, i);
delay(10);
//NEED TO BREAK THE FOR LOOP BUT HAVE LED STAY 255 BRIGHTNESS ONCE REACHED?
}
}
}