Scheduler library upload error

All,

I wonder if someone could help me here.

I’m working on a Uno R3 with Arduino 1.6.1 (I’m using 1.6.1 rather than 1.6.3 as I eventually want to use Visual Micro and that doesn’t have a non-beta release for 1.6.3 yet). This example however is not using Visual Micro but the Arduino UI.

I’m trying to make use of the core Scheduler library. I’m seeing a compile error message even before I do anything with the library.

If I choose to open the example “MultipleBlinks” and upload it to the board, then I get:

WARNING: library Scheduler claims to run on [sam] architecture(s) and may be incompatible with your current board which runs on [avr] architecture(s).

C:\Users\tdelve\AppData\Local\Temp\cc82jaXr.s: Assembler messages:
C:\Users\tdelve\AppData\Local\Temp\cc82jaXr.s:46: Error: constant value required
Error compiling.

Other (non-scheduler) examples will upload and run with no problem.

If I take an empty sketch (i.e., empty startup(), empty loop()) and add the Scheduler library (the core library not a downloaded library), then it will automatically add:

#include <Scheduler.h>

Upon attempting to upload to the board, I get the same error.

Does anyone have any thoughts?

Thanks,

Trefor

tdelve: I'm working on a Uno R3 ...

I'm trying to make use of the core Scheduler library. I'm seeing a compile error message even before I do anything with the library.

Somehow you must have overlooked, that the scheduler library is an "Arduino DUE ONLY" library, which works ONLY WITH 32-BIT CONTROLLERS".

So you see exactly what you should see (if you didn't read anything about the library).

I must have. Thank you.

No I see there is a comment in the example sketch. Is there a way to see which boards a library will work with?

Trefor

Hi,
I wanted to use Arduino Uno to run multiple tasks and I am new to this. I understand that Scheduler can do this job in Arduino Uno but it didn’t work for me. Would you please guide me how to do it.

My project is this,

  1. need a continuous 1KHz 50% duty cycle pulses.
  2. need to sequence up and down a 2 power supplies

#include <Scheduler.h>

/*********************

Power sequencer with 1Khz Clock

**********************/

// Define pins

const int togUp = 8; //Toggle switch - up

const int ch1Pin = 0;
const int ch2Pin = 1;
const int ch3Pin = 2;
const int ch4Pin = 3;
const int ch5Pin = 4;
const int ch6Pin = 5;
const int ch7Pin = 6;
const int ch8Pin = 7;

//Clock out pin
int outPin = A0;

/*******************************************/

void setup()
{
pinMode(togUp, INPUT_PULLUP);

pinMode(ch1Pin, OUTPUT);
pinMode(ch2Pin, OUTPUT);
pinMode(ch3Pin, OUTPUT);
pinMode(ch4Pin, OUTPUT);
pinMode(ch5Pin, OUTPUT);
pinMode(ch6Pin, OUTPUT);
pinMode(ch7Pin, OUTPUT);
pinMode(ch8Pin, OUTPUT);

pinMode(outPin, OUTPUT); // sets the A0 pin as clock output

digitalWrite(ch1Pin, LOW);
digitalWrite(ch2Pin, LOW);
digitalWrite(ch3Pin, LOW);
digitalWrite(ch4Pin, LOW);
digitalWrite(ch5Pin, LOW);
digitalWrite(ch6Pin, LOW);
digitalWrite(ch7Pin, LOW);
digitalWrite(ch8Pin, LOW);

Scheduler.startLoop(loop1);
}

/*************************************************
Main loop to generate Clock & check switch
**************************************************/
void loop()
{
// 1Khz Clock Generation
digitalWrite(outPin, HIGH); // sets the pin on
delayMicroseconds(500); // pauses for 50 microseconds
digitalWrite(outPin, LOW); // sets the pin off
delayMicroseconds(500); // pauses for 50 microseconds
}
void loop1 (){
//Check for toggle up
int toggleState = digitalRead(togUp);
if (toggleState == 0)
sequenceUp();
else
sequenceDn();
yield();
}

/*************************************************
sequence UP
**************************************************/
void sequenceUp()
{
int ch1;
int ch2;
int ch3;
int ch4;
int ch5;
int ch6;
int ch7;
int ch8;

//SequenceUp Delay in milliseconds

ch1 = (100);
ch2 = (100);
ch3 = (100);
ch4 = (100);
ch5 = (100);
ch6 = (100);
ch 7 = (100 );

//Activate the pins
digitalWrite(ch1Pin,HIGH);
delay(ch1);
digitalWrite(ch2Pin,HIGH);
delay(ch2);
digitalWrite(ch3Pin,HIGH);
delay(ch3);
digitalWrite(ch4Pin,HIGH);
delay(ch4);
digitalWrite(ch5Pin,HIGH);
delay(ch5);
digitalWrite(ch6Pin,HIGH);
delay(ch6);
digitalWrite(ch7Pin,HIGH);
delay(ch7);
digitalWrite(ch8Pin,HIGH);
}

/*************************************************
sequence Down
**************************************************/
void sequenceDn()
{
int ch1;
int ch2;
int ch3;
int ch4;
int ch5;
int ch6;
int ch7;
int ch8;

//SequenceUp Delay in milliseconds

ch1 = (100);
ch2 = (100);
ch3 = (100);
ch4 = (100);
ch5 = (100);
ch6 = (100);
ch7 = (100);

digitalWrite(ch8Pin,LOW);
delay(ch7);
digitalWrite(ch7Pin,LOW);
delay(ch6);
digitalWrite(ch6Pin,LOW);
delay(ch5);
digitalWrite(ch5Pin,LOW);
delay(ch4);
digitalWrite(ch4 Pin,LOW) ;
delay(ch3);
digitalWrite(ch3Pin,LOW);
delay(ch2);
digitalWrite(ch2Pin,LOW);
delay(ch1);
digitalWrite(ch1Pin,LOW);

}

Please help.

Scheduler.h is just for the Due (CMIIW), but there is the OS48 lib for AVRs.

http://www.rtos48.com/

Anyway, I always recommend not to use a cpu providing less than 8 kB RAM at all, neither for mutlitasking nor for SPI or SD nor for either task.
ok, except for a henhouse flap, perhaps.

@Kurien, have a look at the demo Several Things at a Time. It may be sufficient for your requirements.

...R