Modifications

Sauter à la navigation Sauter à la recherche
246 octets supprimés ,  23 septembre 2018 à 18:57
Ligne 158 : Ligne 158 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
En utilisant la classe '''Adafruit_M0_Express_CircuitPython''' vous obtenez un objet de type ''système de fichier'' compatible avec en lecture et écriture avec le formattage de la mémoire Flash de CircuitPython. C'est très important pour l'interopérabilité entre CircuitPython et Arduino étant donné que CircuitPython dispose d'un partitionnement spécifique et d'un agencement particulier de la mémoire flash qui n'est pas compatible avec des bibliothèque plus "simple" (que vous pourriez rencontrer dans les autres exemples).
+
By using the '''Adafruit_M0_Express_CircuitPython''' class, you get a "File System" objet type compatible with read/write operations over a CircuitPython file system. This point is important for the interoperability between CirctuitPython and Arduino. CircuitPython use a particular partitioning of the Flash which is not compatible simpler library (like those mentionned in another examples).
   −
Une fois l'instance de la classe '''Adafruit_M0_Express_CircuitPython''' créée (instance appelée '''pythonfs''' dans le croquis) vous pouvez interagir avec elle comme s'il s'agissait de la [https://www.arduino.cc/en/Reference/SD bibliothèque carte SD d'Arduino]. Vous pouvez ouvrir des fichiers en lecture ou écriture, créer des répertoires, effacer des fichiers et répertoires et plus encore.
+
One the '''Adafruit_M0_Express_CircuitPython''' class instance created  (instance named '''pythonfs''' in the sketch) you can interact with the file system like [https://www.arduino.cc/en/Reference/SD an Arduino's SD library]. You can open files in read/write mode, create folder, drop files and folders (and even more).
   −
Voici un croquis qui vérifie la présence du fichier '''boot.py''' et affiche sont contenu (un caractère à la fois):
+
Here a sketch looking for the '''boot.py''' file and displaying its content on the screen (char by char):
    
<syntaxhighlight lang="c">
 
<syntaxhighlight lang="c">
   // Vérifie si le fichier boot.py existe puis affiche le contenu.
+
   // Check the boot.py file existence THEN display it on the screen
 
   if (pythonfs.exists("boot.py")) {
 
   if (pythonfs.exists("boot.py")) {
 
     File bootPy = pythonfs.open("boot.py", FILE_READ);
 
     File bootPy = pythonfs.open("boot.py", FILE_READ);
Ligne 176 : Ligne 176 :  
   }
 
   }
 
   else {
 
   else {
     Serial.println("Pas de fichier boot.py...");
+
     Serial.println("No boot.py file...");
 
   }
 
   }
 
</syntaxhighlight>
 
</syntaxhighlight>
29 837

modifications

Menu de navigation