Skip to content

Commit

Permalink
Update some files (will explain in next push)
Browse files Browse the repository at this point in the history
  • Loading branch information
asherevan authored Dec 18, 2024
1 parent 46c7c55 commit 60c3f7c
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 428 deletions.
40 changes: 12 additions & 28 deletions boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
os.chdir('/system')
import machine
import time
import st7789
from sound import playsound
import network
from micropython import const
Expand All @@ -12,38 +11,23 @@
import vga1_bold_16x32 as fontlarge
import urequests as requests
import _thread as thread
import sdcard
import json

execfile('appRefresh.py')
os.chdir('drivers')

xa = machine.ADC(machine.Pin(36))
ya = machine.ADC(machine.Pin(39))
btn = machine.Pin(32, machine.Pin.IN, machine.Pin.PULL_UP)
sc = machine.Pin(22, machine.Pin.OUT)
index=open('drivers.conf', 'r')
j = json.load(index)

sc.on()
execfile(j['display'])
execfile(j['direction'])
execfile(j['SDreader'])
execfile(j['keyboard'])

xa.atten(xa.ATTN_11DB)
ya.atten(ya.ATTN_11DB)

minval = const(500)
maxval = const(2500)

upamount = 40

spi = machine.SPI(1, baudrate=40000000, polarity=1)
display = st7789.ST7789(spi, 240, 240, reset=machine.Pin(27, machine.Pin.OUT), dc=machine.Pin(26, machine.Pin.OUT), backlight=sc)
display.init()
print('Drivers initialized')

os.chdir('/')

try:
sdspi=machine.SoftSPI(-1, sck=machine.Pin(18), mosi=machine.Pin(23), miso=machine.Pin(19))
sd = sdcard.SDCard(sdspi, machine.Pin(5))
os.mount(sd, '/sd')
print('SD card mounted.')
except Exception as e:
print('No SD card present.')
execfile('system/appRefresh.py')

LOGGING = True
LOGFILENAME = ''
Expand All @@ -55,9 +39,9 @@ def log(text):
logfile.write(str(time.localtime()[3])+':'+str(time.localtime()[4])+':'+str(time.localtime()[5])+': '+str(text))
logfile.close()
else:
print(str(time.localtime()[3])+':'+str(time.localtime()[4])+': '+str(text))
print(str(time.localtime()[3])+':'+str(time.localtime()[4])+':'+str(time.localtime()[5])+': '+str(text))

if btn.value() == 0:
if btn.value() != 0:
try:
logs=os.listdir('/sd/.logs')
logs.reverse()
Expand Down
Loading

0 comments on commit 60c3f7c

Please sign in to comment.