4._arduino
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| 4._arduino [2025/12/12 06:07] – mistert2 | 4._arduino [2025/12/12 09:45] (Version actuelle) – mistert2 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ==== ALGORITHMIE ET PROGRAMMATION ==== | ==== ALGORITHMIE ET PROGRAMMATION ==== | ||
| + | |||
| + | **Correction de l' | ||
| + | |||
| + | {{ https:// | ||
| + | |||
| + | <code C++> | ||
| + | // C++ code | ||
| + | // | ||
| + | void setup() | ||
| + | { | ||
| + | pinMode(3, | ||
| + | Serial.begin(9600); | ||
| + | } | ||
| + | |||
| + | void loop() | ||
| + | { | ||
| + | int ldr = analogRead(A0); | ||
| + | float lux = 4.705 * ldr - 2648; | ||
| + | | ||
| + | if (lux < 200) { | ||
| + | digitalWrite(3, | ||
| + | } else if (lux > 600) { | ||
| + | | ||
| + | } | ||
| + | | ||
| + | Serial.print(" | ||
| + | Serial.print(ldr); | ||
| + | Serial.print(" | ||
| + | Serial.println(lux); | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | {{ ::ldr.png |}} | ||
| {{https:// | {{https:// | ||
4._arduino.1765519647.txt.gz · Dernière modification : de mistert2
