0
0
FreeRTOSprogramming~10 mins

What is an RTOS in FreeRTOS - Interactive Quiz & Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a FreeRTOS task that prints "Hello RTOS".

FreeRTOS
void vTaskCode( void * pvParameters ) {
    for( ;; ) {
        printf([1]);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}
Drag options to blanks, or click blank then click option'
AHello_Rtos
BHello RTOS
C'Hello RTOS'
D"Hello RTOS"
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes instead of double quotes for strings.
Not using quotes at all, which causes a syntax error.
2fill in blank
medium

Complete the code to start the FreeRTOS scheduler.

FreeRTOS
int main(void) {
    // Create tasks here
    [1]();
    for( ;; );
}
Drag options to blanks, or click blank then click option'
AvTaskStartScheduler
BvStartScheduler
CstartScheduler
DvSchedulerStart
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect function names that do not exist in FreeRTOS.
Forgetting to call the scheduler function.
3fill in blank
hard

Fix the error in the task creation code by filling the missing parameter.

FreeRTOS
xTaskCreate(
    vTaskCode,       // Task function
    "Task1",        // Name
    1000,            // Stack size
    NULL,            // Parameters
    1,               // Priority
    [1]      // Task handle
);
Drag options to blanks, or click blank then click option'
A0
BNULL
C1
DvTaskHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Passing an integer instead of a pointer.
Passing an uninitialized variable.
4fill in blank
hard

Fill both blanks to create a dictionary of task names and their priorities.

FreeRTOS
const char* tasks[] = {"TaskA", "TaskB", "TaskC"};
int priorities[] = {1, 2, 3};

for(int i = 0; i < 3; i++) {
    printf("%s priority: %d\n", [1], [2]);
}
Drag options to blanks, or click blank then click option'
Atasks[i]
Bpriorities[i]
Ctasks
Dpriorities
Attempts:
3 left
💡 Hint
Common Mistakes
Using array names without index, which prints the pointer address.
Mixing up tasks and priorities arrays.
5fill in blank
hard

Fill all three blanks to create a task that toggles an LED every 500ms.

FreeRTOS
void [1]( void * pvParameters ) {
    for( ;; ) {
        [2]();
        vTaskDelay([3] / portTICK_PERIOD_MS);
    }
}
Drag options to blanks, or click blank then click option'
AvToggleLED
BvTaskToggleLED
C500
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong function names.
Using 1000 instead of 500 for delay.