|
3 | 3 | # script to automatically initialize the hardware when the board boots up. See:
|
4 | 4 | # https://micropython.org/resources/docs/en/latest/reference/reset_boot.html#id4
|
5 | 5 |
|
| 6 | +# Import the display driver |
6 | 7 | try:
|
7 | 8 | from .display import display
|
8 | 9 | except:
|
9 | 10 | print("Display initialization failed, skipping...")
|
10 | 11 |
|
| 12 | +# Optional - show a splash image on the display if one is available, or clear |
| 13 | +# the display of any previous content |
| 14 | +if not display.splash(): |
| 15 | + if hasattr(display, 'clear'): |
| 16 | + display.clear() |
| 17 | + |
| 18 | +# Import the camera driver |
11 | 19 | try:
|
12 | 20 | from .camera import camera
|
13 | 21 | except:
|
14 | 22 | print("Camera initialization failed, skipping...")
|
15 | 23 |
|
| 24 | +# Import the touch screen driver |
16 | 25 | try:
|
17 | 26 | from .touch_screen import touch_screen
|
18 | 27 | except:
|
19 | 28 | print("Touch screen initialization failed, skipping...")
|
20 | 29 |
|
| 30 | +# Mount the SD card |
21 | 31 | try:
|
22 | 32 | # We don't actually need to import anything here, just want to run the
|
23 | 33 | # sd_card module so the SD card gets mounted to the filesystem. So just
|
|
26 | 36 | del sdcard
|
27 | 37 | except:
|
28 | 38 | print("SD card initialization failed, skipping...")
|
29 |
| - |
30 |
| -# Optional - show a splash image on the display if one is available, or clear |
31 |
| -# the display of any previous content |
32 |
| -try: |
33 |
| - # Load and display a splash image, if one is available |
34 |
| - import cv2 |
35 |
| - splash_image = cv2.imread("splash.png") |
36 |
| - cv2.imshow(display, splash_image) |
37 |
| -except Exception: |
38 |
| - # No splash image, instead clear the display if the driver supports it |
39 |
| - if hasattr(display, 'clear'): |
40 |
| - display.clear() |
0 commit comments