/**
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#define LED_PIN 11
#define BTN_PIN 5
int main() {
// Inicialização do SDK
stdio_init_all();
gpio_init(LED_PIN);
gpio_init(BTN_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
gpio_set_dir(BTN_PIN, GPIO_IN);
printf("Sistema inicializado. Pressione o botão!\n");
while (1) {
while(gpio_get(BTN_PIN))
{
gpio_put(LED_PIN, 1);
}
gpio_put(LED_PIN, 0);
}
}