# test_camera.py
from maix import camera, display, time

try:
    print("Initializing camera...")
    cam = camera.Camera(640,480)
    # cam = camera.Camera(1280,720)
    # cam.get_exposure_us()
    # print("Camera exposure: ", cam.get_exposure_us())
    print("Camera initialized successfully!")
    
    disp = display.Display()
    
    while True:
        frame = cam.read()
        disp.show(frame)
        time.sleep_ms(50)
        
except Exception as e:
    print(f"Error: {e}")