Problem with Arduino and Erika os

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
gio.rogo
Newbie
Posts: 3
Joined: Thu Apr 27, 2017 12:59 pm

Problem with Arduino and Erika os

Post by gio.rogo » Thu Apr 27, 2017 1:18 pm

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 327 times

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Problem with Arduino and Erika os

Post by paolo.gai » Thu Apr 27, 2017 1:30 pm

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

PJ

gio.rogo
Newbie
Posts: 3
Joined: Thu Apr 27, 2017 12:59 pm

Re: Problem with Arduino and Erika os

Post by gio.rogo » Thu Apr 27, 2017 1:49 pm

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
Newbie
Posts: 3
Joined: Thu Apr 27, 2017 12:59 pm

Re: Problem with Arduino and Erika os

Post by gio.rogo » Sat Apr 29, 2017 7:32 am

Problem solved! Thank you all

Post Reply