from machine import Pin 
import utime 

# Konfigurasi pin 
BUZZER = Pin(13, Pin.OUT) 
Button1 = Pin(7, Pin.IN, Pin.PULL_UP) 
Button2 = Pin(9, Pin.IN, Pin.PULL_UP) 

def buzz(duration): 
    BUZZER.value(1)  # Nyalakan buzzer 
    utime.sleep_ms(duration) 
    BUZZER.value(0)  # Matikan buzzer 

while True: 
    Button1State = Button1.value() 
    Button2State = Button2.value() 
    
    # Jika kedua tombol ditekan secara bersamaan
    if Button1State == 0 and Button2State == 0: 
        print("kedua tombol ditekan, buzzer aktif 1 detik") 
        buzz(1000) 
    
    utime.sleep_ms(1)  # Debounce sederhana
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT