ProtoThreads

Hello, I am creating a code with protothreads and I get the following error when compiling
““jump to case label [-fpermissive]””
the funny thing is that it only happens when I compile with the arduino DUE board, with other boards if you compile.
I hope you can help me

#include<pt.h>
#include<Servo.h>
static struct pt hilo1;
Servo servo1;
static int mov(struct pt *pt)
{
static unsigned long t = 0;
PT_BEGIN(pt);
for(int i=0; i <= 120; i++ ){
t = millis();
PT_WAIT_UNTIL(pt, millis() - t > 100);
servo1.write(i);
}
PT_END(pt);
}

void setup() {
servo1.attach(9);
PT_INIT(&hilo1);
}

void loop(){
servo1.write(0);
mov(&hilo1,100);
}

Hi kjaiser,

What line of code is the error about? Can you please post your code in code tags.

Kind regards,

Zeb

Read the guide at the top of this section which will Explain how to post code in code tags, how to post your error message and how to make a good post in general.