Archived
debug stuff
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"python.pythonPath": "C:\\Program Files\\Python38\\python.exe"
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ from PIL import ImageFont, ImageDraw, Image
|
|||||||
# load more needed modules
|
# load more needed modules
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
# load randommodules
|
# load randommodules
|
||||||
#from random import randint, gauss
|
#from random import randint, gauss
|
||||||
@@ -29,11 +30,25 @@ RST_PIN = 25 #Reset
|
|||||||
CS_PIN = 8
|
CS_PIN = 8
|
||||||
DC_PIN = 24
|
DC_PIN = 24
|
||||||
|
|
||||||
|
# set variables
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# define display settings and create display device
|
||||||
serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpio_DC = DC_PIN, gpio_RST = RST_PIN)
|
serial = spi(device=0, port=0, bus_speed_hz = 8000000, transfer_size = 4096, gpio_DC = DC_PIN, gpio_RST = RST_PIN)
|
||||||
device_used = sh1106(serial, rotate=2) #sh1106
|
device_used = sh1106(serial, rotate=2) #sh1106
|
||||||
|
|
||||||
|
# get udev context
|
||||||
context = pyudev.Context()
|
context = pyudev.Context()
|
||||||
|
|
||||||
|
def prepSystem():
|
||||||
|
Path("/data/images").mkdir(parents=True, exist_ok=True)
|
||||||
|
Path("/data/thumbnails").mkdir(parents=True, exist_ok=True)
|
||||||
|
Path("/data/mnt_sd").mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
while True:
|
while True:
|
||||||
@@ -43,8 +58,11 @@ def main():
|
|||||||
monitor.filter_by('block')
|
monitor.filter_by('block')
|
||||||
for device in iter(monitor.poll, None):
|
for device in iter(monitor.poll, None):
|
||||||
if 'ID_FS_TYPE' in device:
|
if 'ID_FS_TYPE' in device:
|
||||||
term.println('{0} partition {1}'.format(device.action, device.get('ID_FS_LABEL')))
|
|
||||||
time.sleep(5)
|
|
||||||
|
term.println("SD-Card inserted. Starting copy...")
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user