We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bff94f7 commit f5a2887Copy full SHA for f5a2887
pico/boot.py
@@ -0,0 +1,19 @@
1
+"""
2
+boot.py file for Pico data logging example. If pin GP0 is connected to GND when
3
+the pico starts up, make the filesystem writeable by CircuitPython.
4
5
+import board
6
+import digitalio
7
+import storage
8
+from buttons import btns, pins
9
+
10
+print(f"Checking if btn[0]={pins[0]} is pressed.")
11
12
+# If write pin is connected to ground on start-up, CircuitPython can write to CIRCUITPY filesystem.
13
+if not btns[0].value:
14
+ print("Mounting as read-only for host! Disabling storage and serial port.")
15
+ storage.remount("/", readonly=False)
16
+ storage.disable_usb_drive()
17
+ usb_cdc.disable()
18
+else:
19
+ print("Not pressed. Starting in RW mode.")
0 commit comments