Two separate loops with arduino

Hello how can I fix the errors in the arduino 1.6.5 ide

// 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();
}

Your code is making a call to Wprogram.h

The usual way to fix a non-updated file is to add the following to the file that tries to load wprogram.h (which got renamed during the IDE 1.0 transition)

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

Has google completely failed you?

Oke I add the following code to the Scheduler.h file and now the next error in the ide.

Arduino: 1.6.5 (Windows 8.1), Board:"Arduino/Genuino Uno"

sketch_dec17a.ino: In function 'void setup()':
sketch_dec17a:18: error: expected unqualified-id before '.' token
sketch_dec17a:19: error: expected unqualified-id before '.' token
expected unqualified-id before '.' token

You can see the attachment also.

@ Delta_G

I want to light up one led for 20 seconds if the pir sensor is activated en then send something every 3 seconds to the server, and it is not possible with delay because the Processorarchitectuur will wait the whole loop.

@Atlanta, you may find the demo Several Things at a Time useful. It illustrates the use of millis() to manage timing without blocking. It is an extended example of BWoD.

...R