PeterH is correct, I did not write the sketch properly. I need a signature under my avatar that says "Warning Novice on board!" .
I rewrote the return sketch, I think it is correct this time. Sorry for the mistake I made earlier.
const int ledPin = 13; // the number of the LED pin
// Variables will change:
int DonesAnswer = 0; // variable to pass "done" to
long previousMillis = 0; // will store last time LED was updated
long interval = 1200; // interval at which to blink (milliseconds)
void setup() {
// set the digital pin as output:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval)
{
// save the last time you blinked the LED
previousMillis = currentMillis;
DonesAnswer = whatdonedoes(); // transfer "done" to DonesAnswer using the function
Serial.print("done = ");
Serial.println(DonesAnswer);
digitalWrite(ledPin, DonesAnswer);
}
}
////////////////////////////////function with a return called done//////////
int whatdonedoes()
{
static int done = 0; //set done to static int
// if the LED is off turn it on and vice-versa:
if (done == 1)
done = 0;
else
done = 1;
return done;
}