mirror of
https://github.com/dbisu/pico-ducky.git
synced 2025-12-06 02:41:45 +00:00
Updated to check the DOWN button on boot
This commit is contained in:
7
boot.py
7
boot.py
@@ -1,9 +1,13 @@
|
|||||||
from board import *
|
from board import *
|
||||||
import digitalio
|
import digitalio
|
||||||
import storage
|
import storage
|
||||||
|
import board
|
||||||
|
import time
|
||||||
|
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
noStorageStatus = False
|
noStorageStatus = False
|
||||||
noStoragePin = digitalio.DigitalInOut(GP15)
|
noStoragePin = digitalio.DigitalInOut(board.IO18) ## If the down button is pressed on the S2 Nugget
|
||||||
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
|
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
|
||||||
noStorageStatus = not noStoragePin.value
|
noStorageStatus = not noStoragePin.value
|
||||||
|
|
||||||
@@ -14,3 +18,4 @@ if(noStorageStatus == True):
|
|||||||
else:
|
else:
|
||||||
# normal boot
|
# normal boot
|
||||||
print("USB drive enabled")
|
print("USB drive enabled")
|
||||||
|
# Write your code here :-)
|
||||||
|
|||||||
Reference in New Issue
Block a user