import supply_voltage #导入它，开启电量指示呼吸灯功能
import controller
import time
import buzzer
import led


while True:
    if controller.get_button(controller.A) == True:
        time.sleep(0.5)
        if controller.get_button(controller.A) == True:
            while not controller.get_button(controller.A) == False:
                buzzer.play_tone(440, 50)
            buzzer.stop()
        else:
            buzzer.play_tone(440, 50)
            time.sleep(0.2)
            buzzer.stop()
    if controller.get_button(controller.M) == True:
        time.sleep(0.5)
        if controller.get_button(controller.M) == True:
            while not controller.get_button(controller.M) == False:
                led.on()
                time.sleep(0.1)
                led.off()
                time.sleep(0.1)
        else:
            led.on()
            time.sleep(0.2)
            led.off()
