Modifications

Sauter à la navigation Sauter à la recherche
243 octets supprimés ,  21 septembre 2018 à 21:48
Ligne 142 : Ligne 142 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
== Conversion en virgule flottante (dtostrf) ==
+
== Floating point conversion (dtostrf) ==
Tout comme pour les AVR arduino, la bibliothèque M0 ne propose un support "complet" permettant de convertir une valeur en virgule flottante vers une chaine de caractères.  
+
As for the Arduino AVR, the M0 libraries doesn't offer a full support to convert floating point value to string.  
   −
Les fonctions comme {{fname|sprintf}} ne feront pas la conversion de valeur en virgule flottante. Par chance, la bibliothèque standard AVR-LIBC inclus la fonction {{fname|dtostrf}} qui est capable de gérer cette conversion pour nous.
+
The functions like {{fname|sprintf}} would not convert floating point values. Thankfully, the standard AVR-LIBC includes the {{fname|dtostrf}} function able to handle this conversion.
   −
Malencontreusement, les bibliothèques run-time du M0 ne dispose pas de cette fonction dtostrf! Vous pourriez rencontrer quelques fils de discussions mentionnant '''#include <avr/dtostrf.h>''' pour obtenir la fonction dtostrf. <font color="red">Mais si cela compile, le fonction '''ne fonctionne pas sur un M0'''</font>.
+
Inconveniently, the M0 AVR run-time does not have the dtostrf function! You may see some thread suggesting to '''#include <avr/dtostrf.h>''' the dtostrf function. <font color="red">But this will not work on M0 even if it compiles'''</font>.
   −
A la place, voyez le fil de discussion suivant pour trouver une fonction {{fname|dtostrf}} fonctionnelle que vous pourrez inclure dans votre code:
+
Instead, have a look to this discussion thread to find a {{fname|dtostrf}} function running proprely:
 
* http://forum.arduino.cc/index.php?topic=368720.0
 
* http://forum.arduino.cc/index.php?topic=368720.0
  
29 836

modifications

Menu de navigation