Complete the code to create a queue that can hold 5 integers.
QueueHandle_t xQueue = xQueueCreate([1], sizeof(int));The queue is created to hold 5 integers, so the first parameter should be 5.
Complete the code to send data to the queue from a task.
int data = 100; xQueueSend([1], &data, portMAX_DELAY);
You must send data to the queue handle, which is xQueue.
Fix the error in the code to receive data from the queue.
int receivedValue; if(xQueueReceive([1], &receivedValue, 0) == pdPASS) { // Process receivedValue }
The first parameter must be the queue handle xQueue to receive data from it.
Fill both blanks to create a queue and send data safely.
QueueHandle_t [1] = xQueueCreate(3, sizeof(int)); int value = 42; xQueueSend([2], &value, 0);
The queue is created and stored in myQueue, so both creation and sending use myQueue.
Fill all three blanks to receive data and check the result.
int dataReceived; if(xQueueReceive([1], &[2], [3]) == pdPASS) { // Use dataReceived }
You receive from xQueue, store in dataReceived, and wait indefinitely with portMAX_DELAY.
