expected unqualified id before '.' token

I can't solve it please help

// Include Scheduler since we want to manage multiple tasks.
#include <Scheduler.h>

int led1 = 13;
int led2 = 12;
int led3 = 11;

void setup() {
Serial.begin(9600);

// Setup the 3 pins as OUTPUT
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);

// Add "loop2" and "loop3" to scheduling.
// "loop" is always started by default.
Scheduler.startLoop(loop2);
Scheduler.startLoop(loop3);
}

// Task no.1: blink LED with 1 second delay.
void loop() {
digitalWrite(led1, HIGH);

// IMPORTANT:
// When multiple tasks are running 'delay' passes control to
// other tasks while waiting and guarantees they get executed.
delay(1000);

digitalWrite(led1, LOW);
delay(1000);
}

// Task no.2: blink LED with 0.1 second delay.
void loop2() {
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(100);
}

// Task no.3: accept commands from Serial port
// '0' turns off LED
// '1' turns on LED
void loop3() {
if (Serial.available()) {
char c = Serial.read();
if (c=='0') {
digitalWrite(led3, LOW);
Serial.println("Led turned off!");
}
if (c=='1') {
digitalWrite(led3, HIGH);
Serial.println("Led turned on!");
}
}

// IMPORTANT:
// We must call 'yield' at a regular basis to pass
// control to other tasks.
yield();
}

I believe Scheduler.h works with only the Due (not sure though)
What Arduino are you using?

Arguably, the MOST important part of any compiler error message is the two numbers that tell you EXACTLY WHERE the error was flagged. Why do people keep asking for help, and leaving this vital information out??

Regards,
Ray L.

RayLivingston:
Arguably, the MOST important part of any compiler error message is the two numbers that tell you EXACTLY WHERE the error was flagged. Why do people keep asking for help, and leaving this vital information out??

Regards,
Ray L.

It's almost like some people didn't learn this in school or have years of doing it to know.
But that would be ridiculous!

GoForSmoke:
It's almost like some people didn't learn this in school or have years of doing it to know.
But that would be ridiculous!

I don't think it takes a any education or really any brains to know that if you want help with an error it would be helpful to tell people what the compiler told you.

In the face of the evidence, perhaps it's something else but yeah there are people who need to be told more than once.

I have no problem with that as long as they learn, otherwise it's time wasted.

I'm very happy to help the ones that do learn.
I'm even more happy when they become active community whether they are good at the subject or not.

arifurtcb:
I can't solve it please help

// Include Scheduler since we want to manage multiple tasks.
#include <Scheduler.h>

The delays you have in that code are the opposite of what works well for running multiple tasks.

There are many examples and tutorials showing how to do multiple tasks at once without a black box, errrr, library. If you take the time to go through, learn and mess with the examples then

A) you won't violate what you're supposed to be using.
B) you won't need the library.

The first link at the bottom of my post is to a very good and complete lesson to get people started on the very thing that you want. The second link is further steps that introduce more techniques to take it farther, and not just in processing serial data even though that's the examples and title.

Nick gives the WHY as well as the WHAT and HOW to get you well started.

Once you learn at least enough to ask more specific questions, your time here will benefit you far more.

Looks like Scheduler.h is an obsolete library as it will not even compile its own examples.

Forget it and learn to program properly. A scheduler has no place on a small micro controller.

Definitely. The overhead could be a killer.

OS? We don't need no steenking OS. We can write our own bugs!

Grumpy_Mike:
Looks like Scheduler.h is an obsolete library as it will not even compile its own examples.

Forget it and learn to program properly. A scheduler has no place on a small micro controller.

I'm pretty sure Scheduler is for Due only. It's actually a very "light weight" timer-based task-switcher, nicely done. Overhead is quite minimal.

Regards,
Ray L.

The code posted, available in Arduino 1.58, can be opened using
File :arrow_forward: Examples :arrow_forward: Scheduler :arrow_forward: MultipleBlinks
Works fine - probably a cut and paste problem or wrong board used by the OP.

I see this is therefore a Due question, so I will move this to the Due part of the forum.

Hi,

I had the same trouble recently.
I solved it by downloading https://github.com/fabriceo/SCoop/archive/master.zip
Adding SchedulerARMAVR.zip to the librairies and including it to the sketch instead of Scheduler.h

Now it works fine !

Bye !