#include <stdio.h>
#include "pico/stdlib.h"
#define OUT_H 1
#define OUT_L 0
#define LED 28
#define CHAVE 15
#define OUT 1
#define IN 0
int main()
{
uint8_t estado_chave = 0;
stdio_init_all();
gpio_init(LED);
gpio_set_dir(LED, OUT);
gpio_init(CHAVE);
gpio_set_dir(CHAVE, GPIO_IN);
gpio_pull_up(CHAVE);
printf("Aula3 - Exercicio 3 \n");
sleep_ms(250);
while(true)
{
estado_chave = gpio_get(CHAVE);
if(estado_chave == 0)
{
gpio_put(LED,OUT_H);
sleep_ms(0);
}
else
{
gpio_put(LED,OUT_L);
sleep_ms(0);
}
}
}