It seem the list of files are not updating properly on my pc when the files are modified by the board itself.
To recreate, simply run this code on the camera and then add some files from the PC:
Code: Select all
import os import pyb LED_red = pyb.LED(1) LED_green = pyb.LED(2) LED_blue = pyb.LED(3) # Clear LEDs LED_red.off() LED_green.off() LED_blue.off() # Go! while (True): # List files in root files = os.listdir() # Remove some reserved directories... if "System Volume Information" in files: files.remove("System Volume Information") # If any files are present, delete one if files: # Print message about file deletion print(files) pyb.delay(1000) # Remove file os.remove("/" + files) # Toggle led to indicate file deletion LED_green.toggle() else: # No files found? print("No files found") pyb.delay(1000) LED_red.off() LED_green.off() LED_blue.off()
Is it related to this discussion: viewtopic.php?t=202?