Modifications

Sauter à la navigation Sauter à la recherche
451 octets ajoutés ,  1 mai 2016 à 13:28
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{FEATHER-M0-NAV}}
 
{{FEATHER-M0-NAV}}
  −
{{traduction}}
      
== Préambules ==
 
== Préambules ==
Ligne 99 : Ligne 97 :     
== Conversion en virgule flottante ==
 
== Conversion en virgule flottante ==
Like the AVR Arduinos, the M0 library does not have full support for converting floating point numbers to ASCII strings. Functions like sprintf will not convert floating point. Fortunately, the standard AVR-LIBC library includes the dtostrf function which can handle the conversion for you.
+
Comme pour les AVR Arduino, la bibliothèque M0 n'a pas un support complet pour pour la conversion des nombres en virgule flottante en chaine ASCII. Les fonctions comme sprintf ne convertira pas les nombres en virgule flottante. Par chance, la bibliothèque standard AVR-LIBC inclus la fonction {{fname|dtostrf}} peut prendre en charge cette conversion.
   −
Unfortunately, the M0 run-time library does not have dtostrf.  You may see some references to using '''#include <avr/dtostrf.h>''' to get dtostrf in your code. And while it will compile, it does not work.
+
Malheureusement, la bibliothèque run-time du M0 ne dispose pas de {{fname|dtostrf}}Vous pourriez rencontrer quelques références utilisant '''#include <avr/dtostrf.h>''' pour inclure dtostrf dans votre code... mais même si cela compile, dtostrf ne fonctionnera pas!
   −
Instead, check out this thread to find a working dtostrf function you can include in your code:
+
Nous vous proposons de prendre connaissance du fil de discussion suivant pour trouver une fonction dtostrf que vous pourriez inclure dans votre code:
    
[http://forum.arduino.cc/index.php?topic=368720.0 http://forum.arduino.cc/index.php?topic=368720.0]
 
[http://forum.arduino.cc/index.php?topic=368720.0 http://forum.arduino.cc/index.php?topic=368720.0]
Ligne 110 : Ligne 108 :       −
The ATSAMD21G18 has 32K of RAM, but you still might need to track it for some reason. You can do so with this handy function:
+
L'ATSAMD21G18 dispose de 32K de RAM mais si vous avez besoin de surveiller votre consommation mémoire, vous pouvez le faire avec la fonction suivante:
    
  <nowiki>extern "C" char *sbrk(int i);
 
  <nowiki>extern "C" char *sbrk(int i);
Ligne 119 : Ligne 117 :  
}</nowiki>
 
}</nowiki>
   −
Thx to [http://forum.arduino.cc/index.php?topic=365830.msg2542879#msg2542879 http://forum.arduino.cc/index.php?topic=365830.msg2542879#msg2542879] for the tip!
+
Trouvé grâce à ce message [http://forum.arduino.cc/index.php?topic=365830.msg2542879#msg2542879 http://forum.arduino.cc/index.php?topic=365830.msg2542879#msg2542879] sur le forum Arduino!
    
== Stocker des données en Flash ==
 
== Stocker des données en Flash ==
If you're used to AVR, you've probably used PROGMEM to let the compiler know you'd like to put a variable or string in flash memory to save on RAM. On the ARM, its a little easier, simply add const before the variable name:
+
Si vous êtes un habitué des AVR, vous avez probablement déjà utilisé PROGMEM qui vous permet de compiler une chaîne de caractère dans la mémoire Flash et permet d'économiser de la RAM.  
 +
 
 +
Sur un ARM, c'est même encore plus simple, il suffit d'ajouter un {{fname|const}} devant le nom de la variable:
    
  <nowiki>const char str[] = "My very long string";</nowiki>
 
  <nowiki>const char str[] = "My very long string";</nowiki>
   −
That string is now in FLASH. You can manipulate the string just like RAM data, the compiler will automatically read from FLASH so you dont need special progmem-knowledgeable functions.
+
Cette chaine est maintenant en FLASH. Vous pouvez manipuler la string (chaîne de caractère) comme s'il s'agissait d'une donnée en RAM, le compilateur fera le nécessaire pour effectuer les lectures en FLASH (vous n'avez donc pas besoin de connaître et utiliser les fonctions ''progmem'').
   −
You can verify where data is stored by printing out the address:
+
Vous pouvez vérifier où sont stockées les données en affichant leur adresse:
    
  <nowiki>Serial.print("Address of str $"); Serial.println((int)&str, HEX);</nowiki>
 
  <nowiki>Serial.print("Address of str $"); Serial.println((int)&str, HEX);</nowiki>
   −
If the address is $2000000 or larger, its in SRAM. If the address is between $0000 and $3FFFF Then it is in FLASH
+
Si l'adresse est $2000000 ou supérieur, c'est stocké en SRAM. Si l'adresse est entre $0000 et $3FFFF alors c'est stocké en FLASH
 +
 
 
{{FEATHER-M0-TRAILER}}
 
{{FEATHER-M0-TRAILER}}
29 917

modifications

Menu de navigation