Modifications

Sauter à la navigation Sauter à la recherche
345 octets ajoutés ,  13 juin 2016 à 15:54
Ligne 248 : Ligne 248 :  
[[Fichier:Hack-wipy-button-debounce.jpg|800px]]
 
[[Fichier:Hack-wipy-button-debounce.jpg|800px]]
    +
<syntaxhighlight lang="python">
 +
from debounce import PullUpButton
 +
import time
 +
btn = PullUpButton( 'GP8' )
    +
counter=0
 +
while counter < 5:
 +
    print( 'Pressez le boutton svp' )
 +
    while not btn.is_pressed():
 +
        time.sleep_ms( 100 )
 +
    counter = counter+1
 +
    print( 'counter = %i' % counter )
 +
print( 'voila, c est finit' )
 +
</syntaxhighlight>
    
{{HACK-WIPY-TRAILER}}
 
{{HACK-WIPY-TRAILER}}
29 918

modifications

Menu de navigation