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
Problem with Arduino and Erika os
Moderator: paolo.gai
Problem with Arduino and Erika os
- Attachments
-
- 3Led_task.zip
- (310.66 KiB) Downloaded 560 times
Re: Problem with Arduino and Erika os
Just put the priority of the task linked to the button higher than the others...
PJ
PJ
Re: Problem with Arduino and Erika os
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;
};
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;
};