Hi- Another newbie question.
I want to do 2 things at once and a looking for the best wayto do this.
I have a program that gets a reading and prints it to an LCD screen. There is then a delay so the screen can be read before it is cleared. The process then repeats itself.
While this is going on I want to have an LED lit, to indicate everyhting is working. I want to fade the led in and out usingthe code below.
How do I make the LED continually fade in and out without being interrupted bythe rest of the program, such as the delay for the screen to be read?
Is this something called an interrupt?
for(value = 0 ; value <= 255; value+=5) // fade in (from min to max)
analogWrite(ledpin, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
for(value = 255; value >=0; value-=5) // fade out (from max to min)