From 8d064986ac44dc87fde9329b3230327fd4d2cfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 26 Apr 2022 22:13:20 +0200 Subject: [PATCH] added sleep before loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- boot.py | 28 ++++++++++++++-------------- code.py | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/boot.py b/boot.py index 42b0e1d..6174dde 100644 --- a/boot.py +++ b/boot.py @@ -1,16 +1,16 @@ -# from board import * -# import digitalio -# import storage +from board import * +import digitalio +import storage -# noStorageStatus = False -# noStoragePin = digitalio.DigitalInOut(GP0) -# noStoragePin.switch_to_input(pull=digitalio.Pull.UP) -# noStorageStatus = not noStoragePin.value +noStorageStatus = False +noStoragePin = digitalio.DigitalInOut(GP15) +noStoragePin.switch_to_input(pull=digitalio.Pull.UP) +noStorageStatus = not noStoragePin.value -# if(noStorageStatus == False): -# # don't show USB drive to host PC -# storage.disable_usb_drive() -# print("Disabling USB drive") -# else: -# # normal boot -# print("USB drive enabled") +if(noStorageStatus == False): + # don't show USB drive to host PC + storage.disable_usb_drive() + print("Disabling USB drive") +else: + # normal boot + print("USB drive enabled") diff --git a/code.py b/code.py index b7fe888..d82b684 100644 --- a/code.py +++ b/code.py @@ -69,6 +69,7 @@ def play_pause(): consumer_control.send(ConsumerControlCode.PLAY_PAUSE) print('Play/Pause') +time.sleep(1) while True: if buttonPin.value == False: