# Hardware Test # Blink and LED (GP14) slowly/quickly while a button (GP16) is not-pressed/pressed from machine import Pin # Import Pin class to control GPIO pins from time import sleep_ms # Import millisecond sleep function led = Pin(14, Pin.OUT) # Create an output pin on GPIO14 for the LED button = Pin(16, Pin.IN, Pin.PULL_UP) # Create an input pin on GPIO16 with internal pull‑up resistor while True: # Infinite loop if button.value() == 0: # If button is pressed (input pulled LOW) delay = 100 # Use short delay (fast blink) else: # Otherwise (button not pressed) delay = 1000 # Use long delay (slow blink) led.toggle() # Flip LED state: ON → OFF or OFF → ON sleep_ms(delay) # Wait for the chosen delay before next toggle