Modifications

Sauter à la navigation Sauter à la recherche
267 octets ajoutés ,  3 octobre 2018 à 21:29
Ligne 96 : Ligne 96 :  
  */
 
  */
 
float getVoltage(int pin){
 
float getVoltage(int pin){
 
+
  // AS the sketch does not call the analogReadResolution()
   // Convert digital value between 0 & 4095 to  
+
  //    function to change the analog reading resolution
 +
  // THEN Arduino use the defaut 12 bits resolution!
 +
  // Under 12 bits resolution, the analogRead() returns
 +
  //    a value between 0 & 1024.
 +
  //
 +
   // Convert digital value between 0 & 1024 to  
 
   //    voltage between 0 & 3.3 volts.
 
   //    voltage between 0 & 3.3 volts.
   //    (each unit equal 3.3 / 4095 = 0.805 millivolts)
+
   //    (each unit equal 3.3 / 1024 = 3.2 millivolts)
   return (analogRead(pin) * .000805);
+
   return (analogRead(pin) * .0032);
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
Ligne 110 : Ligne 115 :  
Which produce the following result on the Serial Monitor
 
Which produce the following result on the Serial Monitor
   −
[[Fichier:ENG-CANSAT-TMP36-70.png]]
+
[[Fichier:ENG-CANSAT-TMP36-60.png]]
    
{{ENG-CANSAT-TRAILER}}
 
{{ENG-CANSAT-TRAILER}}
29 917

modifications

Menu de navigation