Page 1 of 1

Problem with Arduino and Erika os

Posted: Thu Apr 27, 2017 1:18 pm
by gio.rogo
Hi everyone, I open this discussion because I have a problem with erika and Arduino.
First I apologize for the not perfect english ..

The problem is this:
I connected 3 leds that came in one after the other in the loop and in addition I connected a button to another led.

The LEDs follow the loop but I just want the button to light up and wait until the loop ends.

At the moment I push the button the LED lights up when the last led of the loop is off.

I used eclipse and I attached the project

Thank you all

----------------------------------------------------------------------------------------------------------------------------
Salve a tutti, apro questa discussione perchè ho un problema con erika e Arduino.

Il problema è questo:
Ho collegato 3 led che si accedono uno dopo l'altro in loop e in più ho collegato un pulsante ad un altro led.

I led seguono il loop ma vorrei che appena premo il pulsante il led si accendesse e non attenda la fine del loop.

Al momento se premo il pulsante il led si accende quando l'ultimo led del loop si è spento.

Ho usato eclipse e allego il progetto

Grazie a tutti

Re: Problem with Arduino and Erika os

Posted: Thu Apr 27, 2017 1:30 pm
by paolo.gai
Just put the priority of the task linked to the button higher than the others...

PJ

Re: Problem with Arduino and Erika os

Posted: Thu Apr 27, 2017 1:49 pm
by gio.rogo
Tell me if this is correct:
In conf.oil do I need to change the PRIORITY value of the task?

this is the task in task.c:

-----------------------------------------
TASK(TaskL4) {
if (digitalRead(buttonPin)==HIGH){
digitalWrite(Blu, HIGH);
delay(tempo);
digitalWrite(Blu, LOW);

}
};
-----------------------------------------

this is the task in conf.oil:
TASK TaskL4 {
PRIORITY = 1;
STACK = SHARED;
SCHEDULE = FULL;
};

Re: Problem with Arduino and Erika os

Posted: Sat Apr 29, 2017 7:32 am
by gio.rogo
Problem solved! Thank you all