Implement notetaking app, ST7796 display with touch support, audio beep navigation, and video streaming
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
# This file is executed on every boot (including wake-boot from deepsleep)
|
||||
import network
|
||||
import time
|
||||
import rlcd
|
||||
import sys
|
||||
|
||||
try:
|
||||
import network
|
||||
has_network = True
|
||||
except ImportError:
|
||||
has_network = False
|
||||
if sys.platform == 'rp2':
|
||||
import st7796 as display_module
|
||||
else:
|
||||
import rlcd as display_module
|
||||
from machine import Pin, SPI
|
||||
import wifi_config
|
||||
|
||||
def connect_wifi():
|
||||
if sys.platform == 'rp2':
|
||||
# Skip display and connection setup on RP2 (no network/Wi-Fi hardware)
|
||||
# Keep the sleep window to make REPL interruption easy
|
||||
time.sleep(1.5)
|
||||
return
|
||||
|
||||
# Initialize display to show connection progress
|
||||
display = None
|
||||
try:
|
||||
# ESP32-S3 configuration
|
||||
spi = SPI(1, baudrate=20000000, polarity=0, phase=0, sck=Pin(11), mosi=Pin(12))
|
||||
display = rlcd.RLCD(spi, cs=Pin(40), dc=Pin(5), rst=Pin(41))
|
||||
display = display_module.RLCD(spi, cs=Pin(40), dc=Pin(5), rst=Pin(41))
|
||||
display.clear(0)
|
||||
|
||||
display.text("ESP32-S3-RLCD-4.2", 10, 10, 1)
|
||||
display.line(10, 20, 390, 20, 1)
|
||||
display.text("Connecting to Wi-Fi...", 10, 35, 1)
|
||||
@@ -21,8 +38,10 @@ def connect_wifi():
|
||||
print("Display init failed in boot.py:", e)
|
||||
|
||||
# Initialize Wi-Fi Station
|
||||
if not has_network:
|
||||
return
|
||||
|
||||
try:
|
||||
import network
|
||||
network.hostname('esp32screen')
|
||||
print("Hostname set to: {}".format(network.hostname()))
|
||||
except Exception as he:
|
||||
|
||||
Reference in New Issue
Block a user