from mangobox import Mango
import time

m = Mango(mode="hardware")
try:
    m.clear()
    m.text("I/O CHECK", 0, 0)
    input("Confirm OLED text, then press Enter: ")
    m.led_all("#00FF00")
    input("Confirm green LEDs, then press Enter: ")
    m.led_off()
    m.beep()
    input("Confirm sound, then press Enter: ")
    print("Press and release the hardware button")
    for sample in range(20):
        print("Button:", m.read_button())
        time.sleep(0.25)
finally:
    m.led_off()
    m.close()
