# 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 2 : Turn ON Motor

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

{

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

}

}
Anyone can modify my example to learn task creation on RTOS Program.

Status
Not open for further replies.