Modifications

Sauter à la navigation Sauter à la recherche
Ligne 93 : Ligne 93 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
Again the '''open''' function is used but this time it's told to open the file for writing.  In this mode the file will be opened for appending (i.e. data added to the end of it) if it exists, or it will be created if it doesn't exist.  Once the file is open print functions like '''print''' and '''println''' can be used to write data to the file (just like writing to the serial monitor).  Be sure to '''close''' the file when finished writing!
+
Cette fois encore, la fonction '''open''' est utilisée pour ouvrir le fichier si ce n'est que cette fois, le fichier est ouvert en lecture (''write'' en anglais). Dans ce mode, le fichier est ouvert en ajout (les données sont ajoutées en fin de fichier) si ce dernier existe. A noter le mode écriture crée le fichier si celui-ci n'existe pas. Une fois le fichier ouvert, les fonctions
 +
 
 +
{{traduction}}
 +
 
 +
 Once the file is open print functions like '''print''' and '''println''' can be used to write data to the file (just like writing to the serial monitor).  Be sure to '''close''' the file when finished writing!
    
That's all there is to basic file reading and writing.  Check out the '''fatfs_full_usage''' example for examples of even more functions like creating directories, deleting files & directories, checking the size of files, and more!  Remember though to interact with CircuitPython files you need to use the '''Adafruit_Feather_M0_CircuitPython''' class as shown in the '''fatfs_circuitpython''' example above!
 
That's all there is to basic file reading and writing.  Check out the '''fatfs_full_usage''' example for examples of even more functions like creating directories, deleting files & directories, checking the size of files, and more!  Remember though to interact with CircuitPython files you need to use the '''Adafruit_Feather_M0_CircuitPython''' class as shown in the '''fatfs_circuitpython''' example above!
29 917

modifications

Menu de navigation