From 69e251de73868c3e7d9a77a4f3d34dcbae220474 Mon Sep 17 00:00:00 2001 From: cube Date: Fri, 7 Mar 2025 03:30:34 +0000 Subject: [PATCH] Add 'CARDPUTER CircuitPython/boot.py' --- CARDPUTER CircuitPython/boot.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 CARDPUTER CircuitPython/boot.py diff --git a/CARDPUTER CircuitPython/boot.py b/CARDPUTER CircuitPython/boot.py new file mode 100644 index 0000000..82af2fe --- /dev/null +++ b/CARDPUTER CircuitPython/boot.py @@ -0,0 +1 @@ +"""CircuitPython Essentials Storage logging boot.py file"""from sys import implementationimport boardimport digitalioimpdigitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False )from sys import implementationimport boardimport digitalioimport storage# The PyDOS file system will be set to Read/Write status for next# power cycle unless a control GPIO is grounded (GP2,5 or 6 depending on the Microcontroller)# in which case the host computer will have Read/Write access and PyDOS will have readonly access.if board.board_id == 'arduino_nano_rp2040_connect': swpin = board.D2elif board.board_id in ['raspberry_pi_pico','cytron_maker_pi_rp2040']: swpin = board.GP6elif board.board_id == 'adafruit_qtpy_esp32c3': swpin = board.A1elif board.board_id == 'adafruit_itsybitsy_rp2040': swpin = board.D7else: if "D5" in dir(board): swpin = board.D5 elif "GP5" in dir(board): swpin = board.GP5 elif "IO5" in dir(board): swpin = board.IO5 elif "D6" in dir(board): swpin = board.D6 elif "GP6" in dir(board): swpin = board.GP6 elif "IO6" in dir(board): swpin = board.IO6 elif "D2" in dir(board): swpin = board.D2 elif "GP2" in dir(board): swpin = board.GP2 elif "IO2" in dir(board): swpin = board.IO2 else: swpin = Noneif swpin: switch = digitalio.DigitalInOut(swpin) switch.direction = digitalio.Direction.INPUT switch.pull = digitalio.Pull.UP# If the switch pin is connected to ground (switch.value == False) allow host to write to the drive if switch.value == False: # Mounts so Host computer can write to micro-flash storage.remount("/", True) print("Switch False (pin grounded), PyDOS FS is ReadOnly") else: storage.remount("/", False) print("Switch True (not grounded), PyDOS FS is ReadWrite") switch.deinit()else: print("If write access from the host is needed, enter the following PyDOS command:\nfs ro") storage.remount("/", False ) \ No newline at end of file