#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
void app_main() {
//definitions
#define LED1 GPIO_NUM_2
#define BUTTON2 GPIO_NUM_18
#define BUTTON3 GPIO_NUM_19
//setting input and output respectively
gpio_set_direction(LED1, GPIO_MODE_OUTPUT);
gpio_set_direction(BUTTON2, GPIO_MODE_INPUT);
gpio_set_direction(BUTTON3, GPIO_MODE_INPUT);
while(1){
//getting the value from the button
int B2 = gpio_get_level(BUTTON2);
int B3 = gpio_get_level(BUTTON3);
//if statements, they only accept when one or the other is on, not both
if (B3 == 1 && B2 == 0){
gpio_set_level(LED1, 1);
}
else if (B3 == 0 && B2 == 1){
gpio_set_level(LED1, 1);
}
else {
gpio_set_level(LED1, 0);
}
}
}