|
| 1 | + |
| 2 | +try: |
| 3 | + import os, Maix, lcd, image,gc,sys |
| 4 | + gc.collect() |
| 5 | + lcd.init() |
| 6 | + loading = image.Image(size=(lcd.width(), lcd.height())) |
| 7 | + loading.draw_rectangle((0, 0, lcd.width(), lcd.height()), fill=True, color=(255, 0, 0)) |
| 8 | + info = "Welcome to MaixPy" |
| 9 | + loading.draw_string(int(lcd.width()//2 - len(info) * 5), (lcd.height())//4, info, color=(255, 255, 255), scale=2, mono_space=0) |
| 10 | + v = sys.implementation.version |
| 11 | + vers = 'V{}.{}.{} : maixpy.sipeed.com'.format(v[0],v[1],v[2]) |
| 12 | + loading.draw_string(int(lcd.width()//2 - len(info) * 6), (lcd.height())//3 + 20, vers, color=(255, 255, 255), scale=1, mono_space=1) |
| 13 | + tf = None |
| 14 | + try: |
| 15 | + os.listdir("/sd/.") |
| 16 | + except Exception as e: |
| 17 | + tf ="SDcard not mount,using flash!" |
| 18 | + loading.draw_string(int(lcd.width()//2 - len(info) * 7), (lcd.height())//2 + 10, tf, color=(255, 255, 255), scale=1, mono_space=1) |
| 19 | + if not tf: |
| 20 | + tf ="SDcard is mount,using sd!" |
| 21 | + loading.draw_string(int(lcd.width()//2 - len(info) * 6), (lcd.height())//2 + 10, tf, color=(255, 255, 255), scale=1, mono_space=1) |
| 22 | + lcd.display(loading) |
| 23 | +finally: |
| 24 | + del loading, v, info, vers |
| 25 | + gc.collect() |
0 commit comments