import machine import pyb # Country is needed to determine WIFI channels restrictions pyb.country('NL') # Pyboard-D runs at 144Mhz by default machine.freq(216000000)
# boot.py -- run on boot-up # can run arbitrary Python, but best to keep it minimal import sys import machine import pyb import os import time import sdcard from machine import I2C, UART, SPI, Pin pyb.country('ES') # ISO 3166-1 Alpha-2 code, eg US, GB, DE, AU #pyb.main('main.py') # main script to run after this one #pyb.usb_mode('VCP+MSC') # act as a serial and a storage device #pyb.usb_mode('VCP+HID') # act as a serial device and a mouse #Acces facil als Pins pin = Pin.board #Montar la SD sd = sdcard.SDCard(SPI(1), pin.PB0) try: os.mount(sd, '/sd') #donar acces a l'import per la sd sys.path.append('/sd') except: print("Hi ha hagut un problema muntant la SD, verificar") ### Per a veure el directori fer: ### os.listdir('/sd')
# This file is executed on every boot (including wake-boot from deepsleep) import machine import uos as os try: import esp esp.osdebug(None) except: pass try: import pyb pyb.country("US") # ISO 3166-1 Alpha-2 code, eg US, GB, DE, AU pyb.usb_mode("VCP+MSC") # act as a serial and a storage device # pyb.main('main.py') # main script to run after this one # pyb.usb_mode('VCP+HID') # act as a serial device and a mouse except: pass SD = False if SD: # Mount SD to /sd try: # Some boards have pulldown and/or LED on GPIO2, pullup avoids issues on TTGO 8 v1.8 # machine.Pin(2,mode=machine.Pin.IN, pull=machine.Pin.PULL_UP) # os.mount(machine.SDCard(slot=1, width=4), "/sd") # SD mode 4 bit if esp: # # SPI 1 bit M5Stack Core os.mount(