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 | ||
python:micropython:gtemps [2021/08/11 09:19] – modification externe 127.0.0.1 | python:micropython:gtemps [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | {{ : | ||
- | ===== MicroPython - Gestion du temps ===== | ||
- | {{ : | ||
- | |||
- | [Mise à jour le : 12/7/2021] < | ||
- | |||
- | * **Ressources** | ||
- | * < | ||
- | * < | ||
- | * < | ||
- | ==== 1. Présentation ==== | ||
- | |||
- | ==== 2. Module time ==== | ||
- | {{ : | ||
- | * **Ressource** : < | ||
- | |||
- | * //Exemple pour un **ESP32 Feather Huzzah** (LED #13)// | ||
- | |||
- | <code Python helloesp32.py> | ||
- | # Faire clignoter la led de la carte | ||
- | |||
- | from machine import Pin | ||
- | import time | ||
- | |||
- | # Led de la carte | ||
- | Led = Pin(13, Pin.OUT) | ||
- | |||
- | while(True): | ||
- | Led.on() | ||
- | time.sleep(1) | ||
- | Led.off() | ||
- | time.sleep(1) | ||
- | | ||
- | </ | ||
- | |||
- | * //Exemples pour un **Raspberry Pi Pico** (LED #25)// | ||
- | |||
- | <code Python hellopico.py> | ||
- | # Exemple 1 | ||
- | # Faire clignoter la led de la carte | ||
- | # A modifier dans le code ci-dessus | ||
- | ... | ||
- | Led = Pin(25, Pin.OUT) | ||
- | ... | ||
- | </ | ||
- | |||
- | {{ : | ||
- | <code Python morse.py> | ||
- | # Exemple 2 | ||
- | # Titre : Message en Morse | ||
- | # Sources | ||
- | # | ||
- | # | ||
- | # fichier : morse.py | ||
- | |||
- | import time | ||
- | from machine import Pin | ||
- | led=Pin(25, | ||
- | BlinkRate=0.25 | ||
- | # Code complet téléchargeable à partir du lien ci-dessous | ||
- | </ | ||
- | |||
- | {{ : | ||
- | <note tip>< | ||
- | |||
- | ==== 3. Module Timer ==== | ||
- | * //Exemple pour un **Raspberry Pi Pico**// | ||
- | |||
- | {{ : | ||
- | <code python *.py> | ||
- | # Faire clignoter la Led de la carte | ||
- | # Ressource : https:// | ||
- | |||
- | from machine import Pin, Timer | ||
- | led = Pin(25, Pin.OUT) | ||
- | timer = Timer() | ||
- | |||
- | def blink(timer): | ||
- | led.toggle() | ||
- | |||
- | timer.init(freq=2.5, | ||
- | </ | ||
- | |||
- | ==== 3. ==== | ||
- | |||
- | * **Ressource** : < | ||
- | * **Matériel** : | ||
- | |||
- | * //Exemple// | ||
- | |||
- | <code python *.py> | ||
- | |||
- | </ | ||
- | |||
- | ==== 4. ==== | ||
- | |||
- | * **Ressource** : < | ||
- | * **Matériel** : | ||
- | |||
- | * //Exemple// | ||
- | |||
- | <code python *.py> | ||
- | |||
- | </ |