File tree Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Original file line number Diff line number Diff line change 11import time
2- import digitalio
32import storage
4- import board
53
6- # Either of these should work for the PyPortal
7- switch = digitalio .DigitalInOut (board .D4 ) # upper port
8- #switch = digitalio.DigitalInOut(board.D3) # lower port
9-
10- switch .direction = digitalio .Direction .INPUT
11- switch .pull = digitalio .Pull .UP
12-
13- # If the switch pin is connected to ground CircuitPython can write to the drive
14- # Use a female/female jumper wire to connect the outer pins in the D4 connecter
15-
16- storage .remount ("/" , disable_concurrent_write_protection = not switch .value )
17- if switch .value :
18- print ("File system is read-only, insert jumper in data port between" )
19- print ("pins 1 and 3 to make it writeable." )
20- else :
21- print ("File system is writable, remove jumper in data port to make" )
22- print ("it read-only and available to CircuitPython." )
4+ print ("**************** WARNING ******************" )
5+ print ("Using the filesystem as a write-able cache!" )
6+ print ("This is risky behavior, backup your files!" )
7+ print ("**************** WARNING ******************" )
238
9+ storage .remount ("/" , disable_concurrent_write_protection = True )
2410time .sleep (5 )
You can’t perform that action at this time.
0 commit comments