Go Down

Topic: Arduino Scheduler not working (Read 2497 times) previous topic - next topic


hi all, i am trying to use time scheduler but i have a problem, with that ,
i toke this code from  here http://playground.arduino.cc/Code/Scheduler#Example
and i downloaded the Scheduler.h but still it dosnot compile  =(

so dose any one can provide any help ?

code :

Code: [Select]
#include <Scheduler.h> // [url=http://playground.arduino.cc/uploads/Code/Scheduler.zip]Scheduler.zip[/url]

Scheduler scheduler = Scheduler();      //create a scheduler

const byte ledPin = 13;               //LED on pin 13

void setup(){
  Serial.begin(9600);                 //Iitialize the UART
  pinMode(ledPin,OUTPUT);             //set pin 13 to OUTPUT

void loop(){
  scheduler.update();                 //update the scheduler, maybe it is time to execute a function?

  if (Serial.available()){            //if we have recieved anything on the Serial
    scheduler.schedule(setHigh,500);  //schedule a setHigh call in 500 milliseconds
    Serial.flush();                   //flush Serial so we do not schedule multiple setHigh calls

void setHigh(){
  digitalWrite(ledPin,HIGH);          //set ledPin HIGH
  scheduler.schedule(setLow,500);     //schedule setLow to execute in 500 milliseconds

void setLow(){
  digitalWrite(ledPin,LOW);           //set ledPin LOW


May 08, 2013, 04:14 pm Last Edit: May 08, 2013, 04:20 pm by johnwasser Reason: 1

it dosnot compile  =(

Can you be more specific?

Did you put Scheduler.cpp and Scheduler.h in libraries/Scheduler?

Did you re-start the IDE after installing the library?

Note: Scheduler.h has not been updated for Arduino 1.0.  Change "Wprogram.h" to "Arduino.h".
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up