Modifications

Sauter à la navigation Sauter à la recherche
42 octets ajoutés ,  26 mars 2020 à 20:49
Ligne 118 : Ligne 118 :     
=== Lire une entrée ===
 
=== Lire une entrée ===
Il faut utiliser la fonction {{fname|digital_read(pin)}} pour lire l'état d'une entrée. La fonction retourne ''1'' si le bouton est pressé (ou entrée activée) sinon elle retourne ''0'' .
+
Il faut utiliser la fonction {{fname|digital_read(pin)}} pour lire l'état d'une entrée. La fonction retourne {{fname|True}} si le bouton est pressé (ou entrée activée) sinon elle retourne '{{fname|False}} .
    
Démarrez un nouvel interpréteur Python et saisissez les instructions suivantes:
 
Démarrez un nouvel interpréteur Python et saisissez les instructions suivantes:
Ligne 129 : Ligne 129 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
Python affiche ''0''.
+
Python affiche {{fname|False}} .
    
Maintenez le premier switch enfoncé (celui portant le libellé ''S0'') et saisissez une nouvelle fois la commande {{fname|digital_read(0)}} .
 
Maintenez le premier switch enfoncé (celui portant le libellé ''S0'') et saisissez une nouvelle fois la commande {{fname|digital_read(0)}} .
   −
Cette fois Python defait afficher ''1''.
+
Cette fois Python devrait afficher {{fname|True}} .
       
{{PiFace2-Manuel-TRAILER}}
 
{{PiFace2-Manuel-TRAILER}}
29 836

modifications

Menu de navigation