Multitasking the Arduino part III

I was selfstudying when I found this sketch on Adafruit, which was part of lessons about multitasking.
But the program has a mistake, whilst I see hat further in the program that mistake should have been Declared … What went wrong here ??

I am just a beginner, and I am trying to understand how sketches work, by using examples, building the sketches, and try to understand them.

Multitasking.ino.ino (10.5 KB)

What's the mistake? Can you post the code inline so we don't have to download it? Use code tags.

The demo Several Things at a Time may be of interest.

...R

Delta G, this sketch was downloaded from the Adafruit website. Normally it all works. I have downloaded several sketches without problems, like the several things at the same time sketch.

But this is the first "finished" sketch which didn't work.
When uploading the sketch to the Arduino this text appears;

Ring1Complete was not declared in this scope.

While furtheron in the sketch these following lines stand;

//------------------------------------------------------------
//Completion Routines - get called on completion of a pattern
//------------------------------------------------------------

// Ring1 Completion Callback
void Ring1Complete()
{
if (digitalRead(9) == LOW) // Button #2 pressed
{
// Alternate color-wipe patterns with Ring2
Ring2.Interval = 40;
Ring1.Color1 = Ring1.Wheel(random(255));
Ring1.Interval = 20000;
}
else // Retrn to normal
{
Ring1.Reverse();
}
}

// Ring 2 Completion Callback
void Ring2Complete()
{
if (digitalRead(9) == LOW) // Button #2 pressed
{
// Alternate color-wipe patterns with Ring1
Ring1.Interval = 20;
Ring2.Color1 = Ring2.Wheel(random(255));
Ring2.Interval = 20000;
}
else // Retrn to normal
{
Ring2.RainbowCycle(random(0,10));
}
}

// Stick Completion Callback
void StickComplete()
{
// Random color change for next scan
Stick.Color1 = Stick.Wheel(random(255));
}

This is the link to the total sketch on the adafruit page.

Please use code tags.

Read this before posting a programming question

How to use this forum

This is the link to the total sketch on the adafruit page.

What link?

Twindummy:
Ring1Complete was not declared in this scope.

The way function prototypes are generated has changed. Add this to your sketch after the #include <Adafruit_NeoPixel.h> line…

void Ring1Complete();
void Ring2Complete();
void StickComplete();

Why?

I did not follow the effort as closely as I usually do so I cannot say for certain. I vaguely recall the change solved some problems with the way #include files / libraries are handled.

However, I may be off in the weeds because I also recall you being the person who brought the change to my attention!

Thank you Coding Badly, with your answer I can compile in IDE 1.6.7 and 1.6.8 without errors.
I found another solution, and that was using the Arduino IDE 1.6.5.

Problem is solved.

Perhaps you might also like to look at my page on multitasking: ArduinoTheOOWay.