#include <stdio.h>
#include "pico/stdlib.h"
#define CH3 20
#define CH2 19
#define CH1 18
#define LED_VERDE 2
int main() {
stdio_init_all();
gpio_init(CH3);
gpio_set_dir(CH3, GPIO_IN);
gpio_pull_up(CH3);
gpio_init(CH2);
gpio_set_dir(CH2, GPIO_IN);
gpio_pull_up(CH2);
gpio_init(CH1);
gpio_set_dir(CH1, GPIO_IN);
gpio_pull_up(CH1);
gpio_init(LED_VERDE);
gpio_set_dir(LED_VERDE, GPIO_OUT);
while (true) {
bool ch3 = !gpio_get(CH3);
bool ch2 = !gpio_get(CH2);
bool ch1 = !gpio_get(CH1);
bool led = false;
if ((ch3 == 0 && ch2 == 0 && ch1 == 1) ||
(ch3 == 0 && ch2 == 1 && ch1 == 0) ||
(ch3 == 1 && ch2 == 0 && ch1 == 0) ||
(ch3 == 1 && ch2 == 1 && ch1 == 1))
{
led = true;
}
gpio_put(LED_VERDE, led);
sleep_ms(50);
}
}