Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
ENG-CANSAT-PICO-THONNY
(voir la source)
Version du 19 février 2022 à 01:32
577 octets ajoutés
,
19 février 2022 à 01:32
→LED Blinking
Ligne 89 :
Ligne 89 :
=== LED Blinking ===
=== LED Blinking ===
Now that we have selected the MicroPython REPL as interactive shell, can use it to control the Pico onboard LED.
Now that we have selected the MicroPython REPL as interactive shell, can use it to control the Pico onboard LED.
+
+
The Pico onboard LED is attached to the pin GP25.
+
+
[[Fichier:ENG-CANSAT-PICO-THONNY-03.png|480px]]
+
+
It can be controled with few lines of codes, just key-in them directly in the REPL session
+
+
<nowiki>from machine import Pin
+
led = Pin(25, Pin.OUT)
+
led.value(1) # allume la LED
+
led.value(0) # éteint la LED</nowiki>
+
+
The following screen capture just show the results of entering the command lines.
+
+
[[Fichier:ENG-CANSAT-PICO-THONNY-04.png|480px]]
+
+
by entering {{fname|led.value()}} without parameter, you can query the output pin state (1 for High level, 0 for Low level).
{{ENG-CANSAT-PICO-TRAILER}}
{{ENG-CANSAT-PICO-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