What is task in Program ?

Status
Not open for further replies.

Parth86

Member
Hello everyone

Embedded systems have a microprocessor or microcontroller connected to some piece of hardware (LEDs, buttons, switches, motors, Buzzer, LCD display, etc.). Generally we write program to control device that connected with microcontroller. Simply we call it task

For example

Task 1 : Blink LED

Task 2 : Turn ON Motor

Task 3 : Buzzer siren

Task 4 : Display message on LCD

In above examples we are doing each task separately. Suppose I have microcontroller connected to LED, Motor, Buzzer and LCD . Now I have multiple tasks

My priority

First LED should be turn ON

If LED is ON , Turn on MOTOR

If MOTOR is Running. Generate tone buzzer

If all three task is complete Than display message “motor is ON “
Now I want to write program than I have to write those four task in main function
C:
int main ( void )

{

vInitSystem();// Initialization of peripherals

while(1) // Infinitive function calling loop

{

vTask1(); // Task 1 Blink LED

vTask2(); // Task 2 If LED is ON turn on Motor

vTask3(); // Task 3 if Motor is on, buzzer will generate tone  

vTask4(); // Task 4 display message “ Motor is ON “

}

}

Anyone can modify my example to learn task creation on RTOS Program.
 
This is usually associated with RTOS.... Real Time Operating System... This is a kernel program that perform tasks

Read here..
Then you can let each task do its job..
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…