#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#define LED_PIN_1 2 //setting the first LED to pin 2
#define LED_PIN_2 15 //setting the second LED to pin 15
void app_main() {
int number;
number = 4;
char status;
status = 'Y';
//changing the pins too output
gpio_set_direction(LED_PIN_1, GPIO_MODE_OUTPUT);
gpio_set_direction(LED_PIN_2, GPIO_MODE_OUTPUT);
//if the number is divisble by 2 then turn on the LED
if (number % 2 == 0) {
gpio_set_level(LED_PIN_1, 1);
} else {
// If number is odd, turn the LED off
gpio_set_level(LED_PIN_1, 0);
}
// if status is Y turn on LED if N dont turn on LED
if (status == 'Y') {
gpio_set_level(LED_PIN_2, 1);
} else if (status == 'N') {
gpio_set_level(LED_PIN_2, 0);
}
}