Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
ENG-CANSAT-TMP36
(voir la source)
Version du 3 octobre 2018 à 21:29
267 octets ajoutés
,
3 octobre 2018 à 21:29
→Low resolution reading
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}}
Admin
Bureaucrates
,
Administrateurs
29 917
modifications
Menu de navigation
Outils personnels
Se connecter
Espaces de noms
Page
Discussion
Variantes
Affichages
Lire
Voir le texte source
Voir l’historique
Plus
Rechercher
Navigation
ARDUINO
RASPBERRY-PI
[:: PI Hacking ::]
Particle.IO
Micro Python
Imprimante 3D
Actualités
Modifications récentes
Page au hasard
Aide
Outils
Pages spéciales
Version imprimable