Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| start:projet:arduino:formation:programmes [2015/02/17 15:39] – créée jcano | start:projet:arduino:formation:programmes [2015/02/17 15:56] (Version actuelle) – [Version simple (avec arrêt)] jcano | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Solutions des programmes ====== | ||
| + | ===== I- Allumer des diodes ===== | ||
| + | ==== 1) Chenillard K2000 ==== | ||
| + | ==== Version bourrin (avec arrêt) ==== | ||
| + | void setup () { | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | void loop () { | ||
| + | for (int i=0; i<10; i++) { | ||
| + | if( i < 5) { | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | else { | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ==== Version plus évoluée (en continu) ==== | ||
| + | void setup () { | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | void loop () { | ||
| + | for (int i=-4; i<4; i++) { | ||
| + | digitalWrite( abs(i), HIGH); | ||
| + | delay(500); | ||
| + | digitalWrite( abs(i), LOW); | ||
| + | | ||
| + | } | ||
| + | } | ||