#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#define LED_PIN 11
#define BTN_PIN 5
#define BTN_POWER 2
int main() {
stdio_init_all();
int x = 0;
bool y = 0;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
gpio_init(BTN_PIN);
gpio_set_dir(BTN_PIN, GPIO_IN);
gpio_init(BTN_POWER);
gpio_set_dir(BTN_POWER, GPIO_OUT);
gpio_put(BTN_POWER, 1);
while (true) {
//printf("Hello, Wokwi!\n");
if(gpio_get(BTN_PIN)){
//printf("Hello, Wokwi!\n");
x++;
sleep_ms(5000);
if(x = 5) {
y = 1;
}
}
if (y) {
gpio_put(LED_PIN, 1);
sleep_ms(500);
gpio_put(LED_PIN, 0);
sleep_ms(500);
}
}
}