FreeRTOS With Arduino Tutorials 2 - How to Handle Tasks with FreeRTOS on Arduino.

preview_player
Показать описание
In this video, we will know how to handle Tasks with FreeRTOS on Arduino.
FreeRTOS: Free Real Time Operating System

Create task function:
void TaskBlink( void *pvParameters )

Create Handle task:
TaskHandle_t TaskHandle_1

Create task:
xTaskCreate(TaskBlink, "Task1", 100, NULL, 2, &TaskHandle_1);
// First param : Function you want to create
// Second param : Name of task
// Third param : Stack memory size
// Fourth param : Param (we don't transfer param so we put it NULL)
// Fifth param : Priority (The highest priority will run first - adding tasks until you run out of RAM)
// Last param : Reference(&) Handletask

Create delay (less accuracy):
vTaskDelay( 1000 / portTICK_PERIOD_MS ); // run per second

Background:
- We don't need to put source code in side void loop() function
- Inside task function, we need to put INFINITE loop:
- while(1) or for(;;)

#ProgrammingKnowledge #Arduino #FreeRTOS #ArduinoTutorial
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

This functionality implemented using freertos can be do using a non blocking delay (use millia) to print once a second in the loop along with a simple if else to control the led using button after the print code.
Tried and tested this and it works.

riding_rascal
Автор

I feel like you should have the while after the digital write, that makes more sense when reading the code. It writes low and then while haults everything until false is returned.

rthu
Автор

where is xTaskCreate? is it a built in function?? i am new to rtos from where should i start? can i start directly freertos with arduino?

yashh
Автор

thansk for all the help bro, keep it up

jibrilsoodeen
Автор

this is great ! but even better if there is a subtitle 😀

beaconing
Автор

if i want to transfer two argument (in and out) of the Task_Print1, how to do that?

muhammadifwatarifbinothman
Автор

Why are you casting to void? Why cast at all if you are not using the params?

rthu
Автор

anh ơi cho em hỏi, em có thể lấy output của 1 task để dùng cho task khác được không, nếu được thì làm như thế nào ạ, em cảm ơn.

duytoanoan
Автор

Please make such a advance video recording arduino . Nice video

narendrasuryawanshi
Автор

Can you please share the circuit diagram.

PriyankaJain-ht
join shbcf.ru