Problem with Arduino and Erika os

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Locked
gio.rogo

Problem with Arduino and Erika os

Post 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
Attachments
3Led_task.zip
(310.66 KiB) Downloaded 560 times
paolo.gai
Administrator
Posts: 877
Joined: Thu Dec 07, 2006 12:11 pm

Re: Problem with Arduino and Erika os

Post by paolo.gai »

Just put the priority of the task linked to the button higher than the others...

PJ
gio.rogo

Re: Problem with Arduino and Erika os

Post 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;
};
gio.rogo

Re: Problem with Arduino and Erika os

Post by gio.rogo »

Problem solved! Thank you all
Locked