Modifications

Sauter à la navigation Sauter à la recherche
Ligne 47 : Ligne 47 :  
Voici comment détecter la pression sur un bouton.
 
Voici comment détecter la pression sur un bouton.
 
   
 
   
GPIO pins can be set up as an input or an output. Output mode is used when you want to supply voltage to a device like an LED or buzzer. With input mode, a GPIO pin has a value that we can read in our code. If the pin has voltage going into it, the reading would be 1 ({{fname|HIGH}}, le niveau haut); if the pin was connected directly to ground (no voltage), the reading would be 0 ({{fname|LOW}}, le niveau bas).
+
Les broches du GPIO peuvent être configurées comme entrée (''input'') ou sortie (''output'' en anglais). Le mode sortie (''output'') est utilisé si vous avez besoin de fournir de l'électricité à un périphérique tel qu'une LED ou un buzzer. Avec le mode en entrée (''input''), une broche du GPIO dispose d'une valeur que vous pouvez lire dans vos programmes. Si une tension est appliqué sur la broche, la lecture renvéra la valeur 1 ({{fname|HIGH}}, le niveau haut); Si la broche est connectée directement sur la masse (dit ''ground'' en anglais, donc sans tension), la lecture retournera la valeur 0 ({{fname|LOW}}, le niveau bas).
 +
 
 +
{{traduction}}
    
The goal is to use a push button to switch voltage on and off for a GPIO pin, thus making the pin's reading change in our code when we press the button.
 
The goal is to use a push button to switch voltage on and off for a GPIO pin, thus making the pin's reading change in our code when we press the button.
29 917

modifications

Menu de navigation