#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"

#define BUTTON_GPIO 1
#define LED 2

int main() {
  stdio_init_all();
    
    gpio_init(BUTTON_GPIO);
    gpio_set_dir(BUTTON_GPIO, GPIO_IN);
    // We are using the button to pull down to 0v when pressed, so ensure that when
    // unpressed, it uses internal pull ups. Otherwise when unpressed, the input will
    // be floating.
    gpio_pull_up(BUTTON_GPIO);


    gpio_init(LED);
    gpio_set_dir(LED, GPIO_OUT);
    //gpio_set_outover(gpio, GPIO_OVERRIDE_INVERT);




  while (true) {
    if (!gpio_get(BUTTON_GPIO)) {
      gpio_put(LED, 1); 
    printf("1!\n");
    } else {
      gpio_put(LED, 0); 
   printf("2!\n");
 
    }

    //printf("Hello, Wokwi!\n");
    sleep_ms(250);
  }
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT