Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes | ||
materiels:capteurs:distance:distus [2024/05/03 11:56] – [2.3 HC-SR04P (GPIO - I2C - UART)] phil | materiels:capteurs:distance:distus [2024/05/18 12:09] – [2.3 HC-SR04P (GPIO - I2C - UART)] phil | ||
---|---|---|---|
Ligne 109: | Ligne 109: | ||
} | } | ||
</ | </ | ||
+ | |||
{{ : | {{ : | ||
Ligne 118: | Ligne 119: | ||
- | === 2.2 Module VMA306 à capteur | + | === 2.2 HC-SR05 |
{{ : | {{ : | ||
+ | == 2.2.1 Présentation == | ||
* // | * // | ||
Ligne 145: | Ligne 147: | ||
* //Connexion à un shield// < | * //Connexion à un shield// < | ||
* // Un premier exemple // {{ : | * // Un premier exemple // {{ : | ||
- | <file cpp HCSR05.cpp> | + | <code cpp HCSR05.cpp> |
/////////////////////////////////////////////// | /////////////////////////////////////////////// | ||
- | // Programme test pour capteur HC-SR05 // | + | // Programme test pour capteur HC-SR05 |
- | // Go Tronic 2017 // | + | // Go Tronic 2017 // |
/////////////////////////////////////////////// | /////////////////////////////////////////////// | ||
#define trigPin 10 // Tinkerkit O1 | #define trigPin 10 // Tinkerkit O1 | ||
Ligne 187: | Ligne 189: | ||
delay(500); // délai entre deux mesures | delay(500); // délai entre deux mesures | ||
} | } | ||
- | </file> | + | </code> |
Ligne 197: | Ligne 199: | ||
=== 2.3 HC-SR04P (GPIO - I2C - UART) === | === 2.3 HC-SR04P (GPIO - I2C - UART) === | ||
- | {{ : | + | {{ : |
== 2.3.1 Présentation == | == 2.3.1 Présentation == | ||
Ligne 215: | Ligne 217: | ||
* Connecteur mâle 4 broches coudé pré-soudé (pas 2,54 mm): Vcc/ | * Connecteur mâle 4 broches coudé pré-soudé (pas 2,54 mm): Vcc/ | ||
* Dimensions: 45,5 x 20,3 x 15,5 mm | * Dimensions: 45,5 x 20,3 x 15,5 mm | ||
+ | |||
+ | * // | ||
{{ : | {{ : | ||
* // | * // | ||
- | * Fichier Acrobat Reader à télécharger < | + | * Fichier Acrobat Reader à télécharger < |
\\ | \\ | ||
+ | |||
+ | {{ : | ||
== 2.3.2 Exemples de code == | == 2.3.2 Exemples de code == | ||
< | < | ||
Ligne 253: | Ligne 259: | ||
duration = pulseIn(echo, | duration = pulseIn(echo, | ||
distance = duration * 340 / 2 / 10000; | distance = duration * 340 / 2 / 10000; | ||
- | | + | Serial.println(" |
- | Serial.println(" | + | |
- | } else { | + | |
- | | + | |
- | } | + | |
delay(3000); | delay(3000); | ||
} | } | ||
Ligne 264: | Ligne 266: | ||
<pane id=" | <pane id=" | ||
- | * // | + | * // |
* // | * // | ||
Ligne 308: | Ligne 310: | ||
<pane id=" | <pane id=" | ||
- | * // | + | * // |
* // | * // | ||
Ligne 346: | Ligne 348: | ||
</ | </ | ||
- | <pane id=" | + | <pane id=" |
A venir | A venir | ||
</ | </ | ||
</ | </ | ||