// Include necessary libraries and headers
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <freertos/semphr.h>
#include "freertos/queue.h"
// Define LED pin numbers
#define LED_PIN1 2
#define LED_PIN2 4
// Declare semaphore and queue handles
SemaphoreHandle_t semaphore;
QueueHandle_t queue;
// Setup function to initialize pins, semaphore, queue, and tasks
void setup() {
Serial.begin(9600);
// Set LED pins as output
pinMode(LED_PIN1, OUTPUT);
pinMode(LED_PIN2, OUTPUT);
// Create a binary semaphore
semaphore = xSemaphoreCreateBinary();
// Create a queue capable of containing 5 integers
queue = xQueueCreate(5, sizeof(int));
// Create sender and receiver tasks
xTaskCreate(senderTask, "senderTask", 1024, NULL, 1, NULL);
xTaskCreate(receiverTask1, "receiverTask1", 1024, NULL, 1, NULL);
xTaskCreate(receiverTask2, "receiverTask2", 1024, NULL, 1, NULL);
}
void loop() {
//Do nothing
}