from machine import Pin
import time

gas = Pin(0, Pin.IN)  # DO pin

while True:
    if gas.value() == 1:
        print("Gas detected!")
    else:
        print("No gas")
    time.sleep(1)